|
|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ktg.iscs.mapper.IsWorkareaMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="IsWorkarea" id="IsWorkareaResult">
|
|
|
<result property="workareaId" column="workarea_id" />
|
|
|
<result property="workareaCode" column="workarea_code" />
|
|
|
@@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectIsWorkareaList" parameterType="IsWorkarea" resultMap="IsWorkareaResult">
|
|
|
<include refid="selectIsWorkareaVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="workareaCode != null and workareaCode != ''"> and workarea_code = #{workareaCode}</if>
|
|
|
<if test="workareaName != null and workareaName != ''"> and workarea_name like concat('%', #{workareaName}, '%')</if>
|
|
|
<if test="workareaType != null and workareaType != ''"> and workarea_type = #{workareaType}</if>
|
|
|
@@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="map != null and map != ''"> and map = #{map}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectIsWorkareaByWorkareaId" parameterType="Long" resultMap="IsWorkareaResult">
|
|
|
<include refid="selectIsWorkareaVo"/>
|
|
|
where workarea_id = #{workareaId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertIsWorkarea" parameterType="IsWorkarea" useGeneratedKeys="true" keyProperty="workareaId">
|
|
|
insert into is_workarea
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
@@ -88,9 +88,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteIsWorkareaByWorkareaIds" parameterType="String">
|
|
|
- delete from is_workarea where workarea_id in
|
|
|
+ delete from is_workarea where workarea_id in
|
|
|
<foreach item="workareaId" collection="array" open="(" separator="," close=")">
|
|
|
#{workareaId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <select id="getIsWorkareaPage" resultType="com.ktg.iscs.domain.vo.workarea.PageWorkareaVO">
|
|
|
+ SELECT
|
|
|
+ w.*,
|
|
|
+ s.workshop_name
|
|
|
+ FROM
|
|
|
+ is_workarea w
|
|
|
+ LEFT JOIN md_workshop s ON s.workshop_id = w.workshop_id
|
|
|
+ <where>
|
|
|
+ <if test="dto.workareaCode != null and dto.workareaCode.trim != ''">
|
|
|
+ and w.workarea_code like concat('%',#{dto.workareaCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.workareaName != null and dto.workareaName.trim != ''">
|
|
|
+ and w.workarea_name like concat('%',#{dto.workareaName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.workareaType != null and dto.workareaType.trim != ''">
|
|
|
+ and w.workarea_type = #{dto.workareaType}
|
|
|
+ </if>
|
|
|
+ <if test="dto.workshopId != null">
|
|
|
+ and w.workshop_id = #{dto.workshopId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by workarea_id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|