| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.ssm.mapper.business.RecruitProjectMapper" >
- <resultMap id="BaseResultMap" type="com.ssm.model.business.RecruitProject" >
- <id column="ProjectID" property="projectid" jdbcType="INTEGER" />
- <result column="ProjectName" property="projectname" jdbcType="VARCHAR" />
- <result column="CompanyId" property="companyid" jdbcType="INTEGER" />
- <result column="PositionName" property="positionname" jdbcType="VARCHAR" />
- <result column="KeyWords" property="keywords" jdbcType="VARCHAR" />
- <result column="Degree" property="degree" jdbcType="VARCHAR" />
- <result column="Experience" property="experience" jdbcType="VARCHAR" />
- <result column="Salary" property="salary" jdbcType="VARCHAR" />
- <result column="PositionNumber" property="positionnumber" jdbcType="VARCHAR" />
- <result column="Detail" property="detail" jdbcType="VARCHAR" />
- <result column="Status" property="status" jdbcType="BIT" />
- <result column="UserId" property="userid" jdbcType="INTEGER" />
- <result column="CreateDate" property="createdate" jdbcType="TIMESTAMP" />
- <result column="UpdateUserId" property="updateuserid" jdbcType="INTEGER" />
- <result column="UpdateDate" property="updatedate" jdbcType="TIMESTAMP" />
- <result column="UserName" property="username" jdbcType="VARCHAR" />
- <result column="bindnum" property="bindnum" jdbcType="VARCHAR" />
- <result column="interviewnum" property="interviewnum" jdbcType="VARCHAR" />
- <result column="luyong" property="luyong" jdbcType="VARCHAR" />
- <result column="ruzhi" property="ruzhi" jdbcType="VARCHAR" />
- <result column="companyname" property="companyname" jdbcType="VARCHAR" />
- <result column="contactname" property="contactname" jdbcType="VARCHAR" />
- <result column="contactmobile" property="contactmobile" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- ProjectID, ProjectName, CompanyId, PositionName, KeyWords, Degree, Experience, Salary,
- PositionNumber, Detail, Status, UserId, CreateDate, UpdateUserId, UpdateDate
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from RecruitProject
- where ProjectID = #{projectid,jdbcType=INTEGER}
- </select>
- <!-- 查询所有正在招聘的项目 -->
- <select id="selectAllRecruitmentProject" resultMap="BaseResultMap">
- SELECT rp.*, rc.CompanyName ,rc.contactmobile,rc.contactname
- FROM
- RecruitProject rp,
- RecruitCompany rc
- WHERE
- rp.Status = 0
- AND rc.CompanyId = rp.CompanyId
- ORDER BY
- rp.ProjectID ASC
-
- </select>
- <!-- 根据公司ID查询公司是否绑定了项目 -->
- <select id="selectByCompanyId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- SELECT * FROM RecruitProject WHERE CompanyId =#{CompanyId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from RecruitProject
- where ProjectID = #{projectid,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.ssm.model.business.RecruitProject" >
- insert into RecruitProject (ProjectID, ProjectName, CompanyId,
- PositionName, KeyWords, Degree,
- Experience, Salary, PositionNumber,
- Detail, Status, UserId,
- CreateDate, UpdateUserId, UpdateDate
- )
- values (#{projectid,jdbcType=INTEGER}, #{projectname,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER},
- #{positionname,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR}, #{degree,jdbcType=VARCHAR},
- #{experience,jdbcType=VARCHAR}, #{salary,jdbcType=VARCHAR}, #{positionnumber,jdbcType=VARCHAR},
- #{detail,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{userid,jdbcType=INTEGER},
- #{createdate,jdbcType=TIMESTAMP}, #{updateuserid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.ssm.model.business.RecruitProject" >
- insert into RecruitProject
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="projectid != null" >
- ProjectID,
- </if>
- <if test="projectname != null" >
- ProjectName,
- </if>
- <if test="companyid != null" >
- CompanyId,
- </if>
- <if test="positionname != null" >
- PositionName,
- </if>
- <if test="keywords != null" >
- KeyWords,
- </if>
- <if test="degree != null" >
- Degree,
- </if>
- <if test="experience != null" >
- Experience,
- </if>
- <if test="salary != null" >
- Salary,
- </if>
- <if test="positionnumber != null" >
- PositionNumber,
- </if>
- <if test="detail != null" >
- Detail,
- </if>
- <if test="status != null" >
- Status,
- </if>
- <if test="userid != null" >
- UserId,
- </if>
- <if test="createdate != null" >
- CreateDate,
- </if>
- <if test="updateuserid != null" >
- UpdateUserId,
- </if>
- <if test="updatedate != null" >
- UpdateDate,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="projectid != null" >
- #{projectid,jdbcType=INTEGER},
- </if>
- <if test="projectname != null" >
- #{projectname,jdbcType=VARCHAR},
- </if>
- <if test="companyid != null" >
- #{companyid,jdbcType=INTEGER},
- </if>
- <if test="positionname != null" >
- #{positionname,jdbcType=VARCHAR},
- </if>
- <if test="keywords != null" >
- #{keywords,jdbcType=VARCHAR},
- </if>
- <if test="degree != null" >
- #{degree,jdbcType=VARCHAR},
- </if>
- <if test="experience != null" >
- #{experience,jdbcType=VARCHAR},
- </if>
- <if test="salary != null" >
- #{salary,jdbcType=VARCHAR},
- </if>
- <if test="positionnumber != null" >
- #{positionnumber,jdbcType=VARCHAR},
- </if>
- <if test="detail != null" >
- #{detail,jdbcType=VARCHAR},
- </if>
- <if test="status != null" >
- #{status,jdbcType=BIT},
- </if>
- <if test="userid != null" >
- #{userid,jdbcType=INTEGER},
- </if>
- <if test="createdate != null" >
- #{createdate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateuserid != null" >
- #{updateuserid,jdbcType=INTEGER},
- </if>
- <if test="updatedate != null" >
- #{updatedate,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.business.RecruitProject" >
- update RecruitProject
- <set >
- <if test="projectname != null" >
- ProjectName = #{projectname,jdbcType=VARCHAR},
- </if>
- <if test="companyid != null" >
- CompanyId = #{companyid,jdbcType=INTEGER},
- </if>
- <if test="positionname != null" >
- PositionName = #{positionname,jdbcType=VARCHAR},
- </if>
- <if test="keywords != null" >
- KeyWords = #{keywords,jdbcType=VARCHAR},
- </if>
- <if test="degree != null" >
- Degree = #{degree,jdbcType=VARCHAR},
- </if>
- <if test="experience != null" >
- Experience = #{experience,jdbcType=VARCHAR},
- </if>
- <if test="salary != null" >
- Salary = #{salary,jdbcType=VARCHAR},
- </if>
- <if test="positionnumber != null" >
- PositionNumber = #{positionnumber,jdbcType=VARCHAR},
- </if>
- <if test="detail != null" >
- Detail = #{detail,jdbcType=VARCHAR},
- </if>
- <if test="status != null" >
- Status = #{status,jdbcType=BIT},
- </if>
- <if test="userid != null" >
- UserId = #{userid,jdbcType=INTEGER},
- </if>
- <if test="createdate != null" >
- CreateDate = #{createdate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateuserid != null" >
- UpdateUserId = #{updateuserid,jdbcType=INTEGER},
- </if>
- <if test="updatedate != null" >
- UpdateDate = #{updatedate,jdbcType=TIMESTAMP},
- </if>
- </set>
- where ProjectID = #{projectid,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ssm.model.business.RecruitProject" >
- update RecruitProject
- set ProjectName = #{projectname,jdbcType=VARCHAR},
- CompanyId = #{companyid,jdbcType=INTEGER},
- PositionName = #{positionname,jdbcType=VARCHAR},
- KeyWords = #{keywords,jdbcType=VARCHAR},
- Degree = #{degree,jdbcType=VARCHAR},
- Experience = #{experience,jdbcType=VARCHAR},
- Salary = #{salary,jdbcType=VARCHAR},
- PositionNumber = #{positionnumber,jdbcType=VARCHAR},
- Detail = #{detail,jdbcType=VARCHAR},
- Status = #{status,jdbcType=BIT},
- UserId = #{userid,jdbcType=INTEGER},
- CreateDate = #{createdate,jdbcType=TIMESTAMP},
- UpdateUserId = #{updateuserid,jdbcType=INTEGER},
- UpdateDate = #{updatedate,jdbcType=TIMESTAMP}
- where ProjectID = #{projectid,jdbcType=INTEGER}
- </update>
-
- <select id="selectAllByCondition" parameterType="com.ssm.model.business.RecruitProject" resultMap="BaseResultMap">
- SELECT rp.*, su.UserName,
- (
- SELECT count(rrp.ResumeProjectId) from ResumeRecruitProject rrp where rrp.ProjectId = rp.ProjectID AND rrp.IsDelete = 0
- ) bindnum,
- (
- SELECT count(i.InterviewId) from Interview i where i.ProjectId = rp.ProjectID AND i.IsDeleted = 0
- ) interviewnum,
- (
- SELECT count(i.InterviewId) from Interview i where i.ProjectId = rp.ProjectID AND i.IsDeleted = 0 AND i.status = '2'
- ) luyong,
- (
- SELECT count(i.InterviewId) from Interview i where i.ProjectId = rp.ProjectID AND i.IsDeleted = 0 AND i.status = '4'
- ) ruzhi
- from RecruitProject rp, SysUser su where 1=1
- AND su.UserID = rp.UserId
- <if test="username != null and username != '' " >
- AND su.UserName LIKE CONCAT('%',#{username},'%')
-
- </if>
- <if test="projectname != null and projectname != '' " >
- AND rp.ProjectName LIKE CONCAT('%',#{projectname},'%')
-
- </if>
- <if test="positionname != null and positionname != '' " >
- AND rp.PositionName LIKE CONCAT('%',#{positionnumber},'%')
-
- </if>
- <if test="status != null " >
- AND rp.Status = #{status,jdbcType=BIT}
- </if>
- ORDER BY rp.CreateDate DESC
- </select>
- <select id="selectUserRole" resultType="java.lang.Integer">
- SELECT count(*) from SysUserRole s
- WHERE s.UserID=#{userid} AND s.RoleID=#{roleid}
- </select>
- </mapper>
|