123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <?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.ym.mec.biz.dal.dao.EmployeeInfoDao">
- <resultMap type="com.ym.mec.biz.dal.entity.EmployeeInfo" id="EmployeeInfo">
- <result column="id_" property="id" />
- <result column="real_name_" property="realName" />
- <result column="mobile_no_" property="mobileNo" />
- <result column="wechat_no_" property="wechatNo" />
- <result column="id_card_" property="idCard" />
- <result column="age_" property="age" />
- <result column="gender_" property="gender" />
- <result column="birthdate_" property="birthdate" />
- <result column="emergency_contact_name_" property="emergencyContactName" />
- <result column="emergency_contact_relation_" property="emergencyContactRelation" />
- <result column="emergency_contact_phone_" property="emergencyContactPhone" />
- <result column="live_city_" property="liveCity" />
- <result column="intention_city_" property="intentionCity" />
- <result column="educational_background_" property="educationalBackground" />
- <result column="subject_id_list_" property="subjectIdList" />
- <result column="assessment_result_" property="assessmentResult" />
- <result column="other_comment_" property="otherComment" />
- <result column="entry_date_" property="entryDate" />
- <result column="position_" property="position" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
- <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
- <result column="is_probation_period_" property="isProbationPeriod" />
- <result column="bank_card_no_" property="bankCardNo" />
- <result column="bank_address_" property="bankAddress" />
- <result column="resignation_date_" property="resignationDate" />
- <result column="organ_id_" property="organId" />
- <result column="operator_id_" property="operatorId" />
- <result column="source_from_" property="sourceFrom" />
- <result column="create_time_" property="createTime" />
- <result column="update_time_" property="updateTime" />
- <result column="organName" property="organName" />
- <result column="subjectName" property="subjectName" />
- <result column="operatorName" property="operatorName" />
- </resultMap>
- <!-- 根据主键查询一条记录 -->
- <select id="get" resultMap="EmployeeInfo">
- SELECT * FROM
- employee_info WHERE id_ = #{id}
- </select>
- <!-- 全查询 -->
- <select id="findAll" resultMap="EmployeeInfo">
- SELECT * FROM employee_info ORDER
- BY id_
- </select>
- <!-- 向数据库增加一条记录 -->
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.EmployeeInfo"
- useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
- AS ID FROM DUAL </selectKey> -->
- INSERT INTO employee_info
- (id_,real_name_,mobile_no_,wechat_no_,id_card_,age_,gender_,birthdate_,emergency_contact_name_,emergency_contact_relation_,emergency_contact_phone_,live_city_,intention_city_,educational_background_,subject_id_list_,assessment_result_,other_comment_,entry_date_,organ_id_,position_,status_,is_probation_period_,bank_card_no_,bank_address_,resignation_date_,operator_id_,source_from_,create_time_,update_time_)
- VALUES(#{id},#{realName},#{mobileNo},#{wechatNo},#{idCard},#{age},#{gender},#{birthdate},#{emergencyContactName},#{emergencyContactRelation},#{emergencyContactPhone},#{liveCity},#{intentionCity},#{educationalBackground},#{subjectIdList},#{assessmentResult},#{otherComment},#{entryDate},#{organId},#{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isProbationPeriod},#{bankCardNo},#{bankAddress},#{resignationDate},#{operatorId},#{sourceFrom},#{createTime},#{updateTime})
- </insert>
- <!-- 根据主键查询一条记录 -->
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.EmployeeInfo">
- UPDATE employee_info
- <set>
- <if test="isProbationPeriod != null">
- is_probation_period_ = #{isProbationPeriod},
- </if>
- <if test="subjectIdList != null">
- subject_id_list_ = #{subjectIdList},
- </if>
- gender_ = #{gender},
- entry_date_ = #{entryDate},
- other_comment_ = #{otherComment},
- <if test="status != null">
- status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- </if>
- educational_background_ = #{educationalBackground},
- emergency_contact_phone_ = #{emergencyContactPhone},
- resignation_date_ = #{resignationDate},
- position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- <if test="updateTime != null">
- update_time_ = #{updateTime},
- </if>
- emergency_contact_relation_ = #{emergencyContactRelation},
- <if test="id != null">
- id_ = #{id},
- </if>
- bank_card_no_ = #{bankCardNo},
- real_name_ = #{realName},
- id_card_ = #{idCard},
- age_ = #{age},
- live_city_ = #{liveCity},
- intention_city_ = #{intentionCity},
- <if test="createTime != null">
- create_time_ = #{createTime},
- </if>
- wechat_no_ = #{wechatNo},
- assessment_result_ = #{assessmentResult},
- mobile_no_ = #{mobileNo},
- emergency_contact_name_ = #{emergencyContactName},
- birthdate_ = #{birthdate},
- bank_address_ = #{bankAddress},
- <if test="organId != null">
- organ_id_ = #{organId},
- </if>
- <if test="operatorId != null">
- operator_id_ = #{operatorId},
- </if>
- source_from_ = #{sourceFrom}
- </set>
- WHERE id_ = #{id}
- </update>
- <!-- 根据主键删除一条记录 -->
- <delete id="delete">
- DELETE FROM employee_info WHERE id_ = #{id}
- </delete>
-
- <sql id="queryPageMap">
- <where>
- <if test="organId != null">
- AND ei.organ_id_ = #{organId}
- </if>
- <if test="userNameOrIdOrMobile != null">
- AND (ei.real_name_ LIKE CONCAT('%',#{userNameOrIdOrMobile},'%') OR ei.mobile_no_ LIKE CONCAT('%',#{userNameOrIdOrMobile},'%') OR ei.id_ = #{userNameOrIdOrMobile})
- </if>
- <if test="subjectId != null">
- AND find_in_set(#{subjectId},ei.subject_id_list_)
- </if>
- <if test="sourceFrom != null">
- AND ei.source_from_ = #{sourceFrom}
- </if>
- <if test="position != null">
- AND ei.position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
- </if>
- <if test="status != null">
- AND ei.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
- </if>
- <if test="startDate != null">
- AND ei.update_time_ >= #{startDate}
- </if>
- <if test="endDate != null">
- AND ei.update_time_ <= #{endDate}
- </if>
- </where>
- </sql>
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="EmployeeInfo" parameterType="map">
- SELECT o.name_ organName,group_concat(s.name_) subjectName,u.real_name_ operatorName,ei.* FROM employee_info ei
- left join subject s on find_in_set(s.id_,ei.subject_id_list_)
- left join organization o on o.id_ = ei.organ_id_
- left join sys_user u on u.id_ = ei.operator_id_
- <include refid="queryPageMap"/>
- GROUP BY ei.id_
- ORDER BY ei.update_time_ desc
- <include refid="global.limit" />
- </select>
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(ei.id_) FROM employee_info ei
- <include refid="queryPageMap"/>
- </select>
- </mapper>
|