|
@@ -5,104 +5,108 @@
|
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
|
-->
|
|
|
<mapper namespace="com.ym.mec.web.dal.dao.EmployeeDao">
|
|
|
-
|
|
|
- <resultMap type="com.ym.mec.web.dal.entity.Employee" id="Employee">
|
|
|
- <result column="user_id_" property="userId" />
|
|
|
- <result column="organ_id_" property="organId" />
|
|
|
- <result column="job_nature_" property="jobNature" />
|
|
|
- <result column="is_probation_period_" property="isProbationPeriod" />
|
|
|
- <result column="education_background_" property="educationBackground" />
|
|
|
- <result column="graduate_school_" property="graduateSchool" />
|
|
|
- <result column="technical_titles_" property="technicalTitles" />
|
|
|
- <result column="entry_date_" property="entryDate" />
|
|
|
- <result column="certificate_type_" property="certificateType" />
|
|
|
- <result column="certificate_num_" property="certificateNum" />
|
|
|
- <result column="update_time_" property="updateTime" />
|
|
|
- <result column="create_time_" property="createTime" />
|
|
|
- <result column="introduction_" property="introduction" />
|
|
|
- <result column="demission_date_" property="demissionDate" />
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <select id="get" resultMap="Employee" >
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.web.dal.entity.Employee" id="Employee">
|
|
|
+ <result column="user_id_" property="userId"/>
|
|
|
+ <result column="organ_id_" property="organId"/>
|
|
|
+ <result column="job_nature_" property="jobNature" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="is_probation_period_" property="isProbationPeriod"
|
|
|
+ typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="education_background_" property="educationBackground"/>
|
|
|
+ <result column="graduate_school_" property="graduateSchool"/>
|
|
|
+ <result column="technical_titles_" property="technicalTitles"/>
|
|
|
+ <result column="entry_date_" property="entryDate"/>
|
|
|
+ <result column="certificate_type_" property="certificateType"/>
|
|
|
+ <result column="certificate_num_" property="certificateNum"/>
|
|
|
+ <result column="update_time_" property="updateTime"/>
|
|
|
+ <result column="create_time_" property="createTime"/>
|
|
|
+ <result column="introduction_" property="introduction"/>
|
|
|
+ <result column="demission_date_" property="demissionDate"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="Employee">
|
|
|
SELECT * FROM employee WHERE user_id_ = #{userId}
|
|
|
</select>
|
|
|
-
|
|
|
- <!-- 全查询 -->
|
|
|
- <select id="findAll" resultMap="Employee">
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="Employee">
|
|
|
SELECT * FROM employee ORDER BY user_id_
|
|
|
</select>
|
|
|
-
|
|
|
- <!-- 向数据库增加一条记录 -->
|
|
|
- <insert id="insert" parameterType="com.ym.mec.web.dal.entity.Employee" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- <!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- INSERT INTO employee (user_id_,organ_id_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,entry_date_,certificate_type_,certificate_num_,update_time_,create_time_,introduction_,demission_date_) VALUES(#{userId},#{organId},#{jobNature},#{isProbationPeriod},#{educationBackground},#{graduateSchool},#{technicalTitles},#{entryDate},#{certificateType},#{certificateNum},#{updateTime},#{createTime},#{introduction},#{demissionDate})
|
|
|
- </insert>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <update id="update" parameterType="com.ym.mec.web.dal.entity.Employee">
|
|
|
- UPDATE employee <set>
|
|
|
-<if test="isProbationPeriod != null">
|
|
|
-is_probation_period_ = #{isProbationPeriod},
|
|
|
-</if>
|
|
|
-<if test="graduateSchool != null">
|
|
|
-graduate_school_ = #{graduateSchool},
|
|
|
-</if>
|
|
|
-<if test="organId != null">
|
|
|
-organ_id_ = #{organId},
|
|
|
-</if>
|
|
|
-<if test="introduction != null">
|
|
|
-introduction_ = #{introduction},
|
|
|
-</if>
|
|
|
-<if test="technicalTitles != null">
|
|
|
-technical_titles_ = #{technicalTitles},
|
|
|
-</if>
|
|
|
-<if test="entryDate != null">
|
|
|
-entry_date_ = #{entryDate},
|
|
|
-</if>
|
|
|
-<if test="jobNature != null">
|
|
|
-job_nature_ = #{jobNature},
|
|
|
-</if>
|
|
|
-<if test="createTime != null">
|
|
|
-create_time_ = #{createTime},
|
|
|
-</if>
|
|
|
-<if test="userId != null">
|
|
|
-user_id_ = #{userId},
|
|
|
-</if>
|
|
|
-<if test="certificateType != null">
|
|
|
-certificate_type_ = #{certificateType},
|
|
|
-</if>
|
|
|
-<if test="updateTime != null">
|
|
|
-update_time_ = #{updateTime},
|
|
|
-</if>
|
|
|
-<if test="educationBackground != null">
|
|
|
-education_background_ = #{educationBackground},
|
|
|
-</if>
|
|
|
-<if test="certificateNum != null">
|
|
|
-certificate_num_ = #{certificateNum},
|
|
|
-</if>
|
|
|
-<if test="demissionDate != null">
|
|
|
-demission_date_ = #{demissionDate},
|
|
|
-</if>
|
|
|
-</set> WHERE user_id_ = #{userId}
|
|
|
- </update>
|
|
|
-
|
|
|
- <!-- 根据主键删除一条记录 -->
|
|
|
- <delete id="delete" >
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.web.dal.entity.Employee" useGeneratedKeys="true" keyColumn="id"
|
|
|
+ keyProperty="id">
|
|
|
+ <!--
|
|
|
+ <selectKey resultClass="int" keyProperty="id" >
|
|
|
+ SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ INSERT INTO employee
|
|
|
+ (user_id_,organ_id_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,entry_date_,certificate_type_,certificate_num_,update_time_,create_time_,introduction_,demission_date_)
|
|
|
+ VALUES(#{userId},#{organId},#{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{entryDate},#{certificateType},#{certificateNum},now(),now,#{introduction},#{demissionDate})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.ym.mec.web.dal.entity.Employee">
|
|
|
+ UPDATE employee
|
|
|
+ <set>
|
|
|
+ <if test="isProbationPeriod != null">
|
|
|
+ is_probation_period_ = #{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="graduateSchool != null">
|
|
|
+ graduate_school_ = #{graduateSchool},
|
|
|
+ </if>
|
|
|
+ <if test="organId != null">
|
|
|
+ organ_id_ = #{organId},
|
|
|
+ </if>
|
|
|
+ <if test="introduction != null">
|
|
|
+ introduction_ = #{introduction},
|
|
|
+ </if>
|
|
|
+ <if test="technicalTitles != null">
|
|
|
+ technical_titles_ = #{technicalTitles},
|
|
|
+ </if>
|
|
|
+ <if test="entryDate != null">
|
|
|
+ entry_date_ = #{entryDate},
|
|
|
+ </if>
|
|
|
+ <if test="jobNature != null">
|
|
|
+ job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ user_id_ = #{userId},
|
|
|
+ </if>
|
|
|
+ <if test="certificateType != null">
|
|
|
+ certificate_type_ = #{certificateType},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="educationBackground != null">
|
|
|
+ education_background_ = #{educationBackground},
|
|
|
+ </if>
|
|
|
+ <if test="certificateNum != null">
|
|
|
+ certificate_num_ = #{certificateNum},
|
|
|
+ </if>
|
|
|
+ <if test="demissionDate != null">
|
|
|
+ demission_date_ = #{demissionDate},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE user_id_ = #{userId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete">
|
|
|
DELETE FROM employee WHERE user_id_ = #{userId}
|
|
|
</delete>
|
|
|
-
|
|
|
- <!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="Employee" parameterType="map">
|
|
|
- SELECT * FROM employee ORDER BY user_id_ <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 查询当前表的总记录数 -->
|
|
|
- <select id="queryCount" resultType="int">
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="Employee" parameterType="map">
|
|
|
+ SELECT * FROM employee ORDER BY user_id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM employee
|
|
|
</select>
|
|
|
</mapper>
|