|
|
@@ -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.IsMaterialsCabinetMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="IsMaterialsCabinet" id="IsMaterialsCabinetResult">
|
|
|
<result property="cabinetId" column="cabinet_id" />
|
|
|
<result property="cabinetCode" column="cabinet_code" />
|
|
|
@@ -24,19 +24,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectIsMaterialsCabinetList" parameterType="IsMaterialsCabinet" resultMap="IsMaterialsCabinetResult">
|
|
|
<include refid="selectIsMaterialsCabinetVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="cabinetCode != null and cabinetCode != ''"> and cabinet_code = #{cabinetCode}</if>
|
|
|
<if test="cabinetName != null and cabinetName != ''"> and cabinet_name like concat('%', #{cabinetName}, '%')</if>
|
|
|
<if test="hardwareId != null "> and hardware_id = #{hardwareId}</if>
|
|
|
<if test="workareaId != null "> and workarea_id = #{workareaId}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectIsMaterialsCabinetByCabinetId" parameterType="Long" resultMap="IsMaterialsCabinetResult">
|
|
|
<include refid="selectIsMaterialsCabinetVo"/>
|
|
|
where cabinet_id = #{cabinetId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertIsMaterialsCabinet" parameterType="IsMaterialsCabinet" useGeneratedKeys="true" keyProperty="cabinetId">
|
|
|
insert into is_materials_cabinet
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
@@ -87,9 +87,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteIsMaterialsCabinetByCabinetIds" parameterType="String">
|
|
|
- delete from is_materials_cabinet where cabinet_id in
|
|
|
+ delete from is_materials_cabinet where cabinet_id in
|
|
|
<foreach item="cabinetId" collection="array" open="(" separator="," close=")">
|
|
|
#{cabinetId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <select id="getIsMaterialsCabinetPage" resultType="com.ktg.iscs.domain.vo.cabinet.IsMaterialsCabinetVO">
|
|
|
+ SELECT
|
|
|
+ c.*,
|
|
|
+ h.hardware_name,
|
|
|
+ w.workarea_name
|
|
|
+ FROM
|
|
|
+ is_materials_cabinet c
|
|
|
+ LEFT JOIN is_hardware h ON c.hardware_id = h.id
|
|
|
+ LEFT JOIN is_workarea w ON c.workarea_id = w.workarea_id
|
|
|
+ <where>
|
|
|
+ <if test="dto.cabinetCode != null and dto.cabinetCode.trim != ''">
|
|
|
+ and c.cabinet_code like concat('%',#{dto.cabinetCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.cabinetName != null and dto.cabinetName.trim != ''">
|
|
|
+ and c.cabinet_name like concat('%',#{dto.cabinetName},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ c.cabinet_id DESC
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|