|
@@ -8,6 +8,8 @@
|
|
|
a.position_name_cn AS "positionNameCn",
|
|
|
a.position_name_en AS "positionNameEn",
|
|
|
a.position_grade AS "positionGrade",
|
|
|
+ a.requirement AS "requirement",
|
|
|
+ a.describe AS "describe",
|
|
|
a.version_no AS "versionNo",
|
|
|
a.create_by AS "createBy.id",
|
|
|
a.create_date AS "createDate",
|
|
@@ -18,6 +20,7 @@
|
|
|
</sql>
|
|
|
|
|
|
<sql id="mdePositionJoins">
|
|
|
+ INNER JOIN mde_department d ON a.DEPD_ID = d.DEPD_ID
|
|
|
</sql>
|
|
|
|
|
|
<select id="get" resultType="MdePosition">
|
|
@@ -27,24 +30,44 @@
|
|
|
<include refid="mdePositionJoins"/>
|
|
|
WHERE a.id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="findList" resultType="MdePosition">
|
|
|
- SELECT
|
|
|
- <include refid="mdePositionColumns"/>
|
|
|
+
|
|
|
+ <select id="getId" resultType="MdePosition">
|
|
|
+ SELECT
|
|
|
+ <include refid="mdePositionColumns"/>
|
|
|
FROM mde_position a
|
|
|
<include refid="mdePositionJoins"/>
|
|
|
- <where>
|
|
|
- a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- ORDER BY a.update_date DESC
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
+ WHERE a.position_id = #{id}
|
|
|
</select>
|
|
|
+ <select id="findList" resultType="MdePosition">
|
|
|
+ SELECT
|
|
|
+ <include refid="mdePositionColumns"/>
|
|
|
+ ,d.DEPD_NAME_CN as 'depdName'
|
|
|
+ FROM mde_position a
|
|
|
+ <include refid="mdePositionJoins"/>
|
|
|
+ <where>
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="positionNameCn != null and positionNameCn != ''">
|
|
|
+ AND a.POSITION_NAME_CN like concat('%',#{positionNameCn},'%')
|
|
|
+ </if>
|
|
|
+ <if test="positionNameEn != null and positionNameEn != ''">
|
|
|
+ AND a.POSITION_NAME_EN like concat('%',#{positionNameEn},'%')
|
|
|
+ </if>
|
|
|
+ <if test="positionGrade != null and positionGrade != ''">
|
|
|
+ AND a.POSITION_GRADE = #{positionGrade}
|
|
|
+ </if>
|
|
|
+ <if test="depdId != null and depdId != ''">
|
|
|
+ AND a.DEPD_ID = #{depdId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
|
|
|
<select id="findAllList" resultType="MdePosition">
|
|
|
SELECT
|
|
@@ -69,6 +92,7 @@
|
|
|
FROM mde_position a
|
|
|
where a.del_flag =0
|
|
|
</select>
|
|
|
+
|
|
|
<insert id="insert">
|
|
|
INSERT INTO mde_position(
|
|
|
position_id,
|
|
@@ -76,7 +100,8 @@
|
|
|
position_name_cn,
|
|
|
position_name_en,
|
|
|
position_grade,
|
|
|
- version_no,
|
|
|
+ requirement,
|
|
|
+ `describe`,
|
|
|
create_by,
|
|
|
create_date,
|
|
|
update_by,
|
|
@@ -89,7 +114,8 @@
|
|
|
#{positionNameCn},
|
|
|
#{positionNameEn},
|
|
|
#{positionGrade},
|
|
|
- #{versionNo},
|
|
|
+ #{requirement},
|
|
|
+ #{describe},
|
|
|
#{createBy.id},
|
|
|
#{createDate},
|
|
|
#{updateBy.id},
|
|
@@ -100,23 +126,24 @@
|
|
|
</insert>
|
|
|
|
|
|
<update id="update">
|
|
|
- UPDATE mde_position SET
|
|
|
- position_id = #{positionId},
|
|
|
+ UPDATE mde_position SET
|
|
|
depd_id = #{depdId},
|
|
|
position_name_cn = #{positionNameCn},
|
|
|
position_name_en = #{positionNameEn},
|
|
|
position_grade = #{positionGrade},
|
|
|
- version_no = #{versionNo},
|
|
|
+ requirement = #{requirement},
|
|
|
+ `describe` = #{describe},
|
|
|
+ version_no =version_no+1,
|
|
|
update_by = #{updateBy.id},
|
|
|
update_date = #{updateDate},
|
|
|
remarks = #{remarks}
|
|
|
- WHERE id = #{id}
|
|
|
+ WHERE position_id = #{positionId}
|
|
|
</update>
|
|
|
|
|
|
<update id="delete">
|
|
|
UPDATE mde_position SET
|
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
|
- WHERE id = #{id}
|
|
|
+ WHERE position_id = #{positionId}
|
|
|
</update>
|
|
|
|
|
|
</mapper>
|