131 lines
7.5 KiB
XML
131 lines
7.5 KiB
XML
<?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.shgx.moldmanagement.mapper.mold.MoldInfoMapper">
|
|
|
|
<resultMap type="MoldInfo" id="MoldInfoResult">
|
|
<result property="moldId" column="mold_id" />
|
|
<result property="moldCode" column="mold_code" />
|
|
<result property="moldName" column="mold_name" />
|
|
<result property="productCode" column="product_code" />
|
|
<result property="productName" column="product_name" />
|
|
<result property="specification" column="specification" />
|
|
<result property="material" column="material" />
|
|
<result property="designLife" column="design_life" />
|
|
<result property="useLife" column="use_life" />
|
|
<result property="moldType" column="mold_type" />
|
|
<result property="manufacturer" column="manufacturer" />
|
|
<result property="productionDate" column="production_date" />
|
|
<result property="status" column="status" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectMoldInfoVo">
|
|
select mold_id, mold_code, mold_name, product_code, product_name, specification, material, design_life, use_life, mold_type, manufacturer, production_date, status, create_by, create_time, update_by, update_time, remark from mold_info
|
|
</sql>
|
|
|
|
<select id="selectMoldInfoList" parameterType="MoldInfo" resultMap="MoldInfoResult">
|
|
<include refid="selectMoldInfoVo"/>
|
|
<where>
|
|
<if test="moldCode != null and moldCode != ''"> and mold_code = #{moldCode}</if>
|
|
<if test="moldName != null and moldName != ''"> and mold_name like concat('%', #{moldName}, '%')</if>
|
|
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
|
|
<if test="material != null and material != ''"> and material = #{material}</if>
|
|
<if test="designLife != null "> and design_life = #{designLife}</if>
|
|
<if test="useLife != null "> and use_life = #{useLife}</if>
|
|
<if test="moldType != null and moldType != ''"> and mold_type = #{moldType}</if>
|
|
<if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
|
|
<if test="productionDate != null "> and production_date = #{productionDate}</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectMoldInfoByMoldId" parameterType="Long" resultMap="MoldInfoResult">
|
|
<include refid="selectMoldInfoVo"/>
|
|
where mold_id = #{moldId}
|
|
</select>
|
|
|
|
<insert id="insertMoldInfo" parameterType="MoldInfo" useGeneratedKeys="true" keyProperty="moldId">
|
|
insert into mold_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="moldCode != null and moldCode != ''">mold_code,</if>
|
|
<if test="moldName != null and moldName != ''">mold_name,</if>
|
|
<if test="productCode != null">product_code,</if>
|
|
<if test="productName != null">product_name,</if>
|
|
<if test="specification != null">specification,</if>
|
|
<if test="material != null">material,</if>
|
|
<if test="designLife != null">design_life,</if>
|
|
<if test="useLife != null">use_life,</if>
|
|
<if test="moldType != null">mold_type,</if>
|
|
<if test="manufacturer != null">manufacturer,</if>
|
|
<if test="productionDate != null">production_date,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="moldCode != null and moldCode != ''">#{moldCode},</if>
|
|
<if test="moldName != null and moldName != ''">#{moldName},</if>
|
|
<if test="productCode != null">#{productCode},</if>
|
|
<if test="productName != null">#{productName},</if>
|
|
<if test="specification != null">#{specification},</if>
|
|
<if test="material != null">#{material},</if>
|
|
<if test="designLife != null">#{designLife},</if>
|
|
<if test="useLife != null">#{useLife},</if>
|
|
<if test="moldType != null">#{moldType},</if>
|
|
<if test="manufacturer != null">#{manufacturer},</if>
|
|
<if test="productionDate != null">#{productionDate},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateMoldInfo" parameterType="MoldInfo">
|
|
update mold_info
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="moldCode != null and moldCode != ''">mold_code = #{moldCode},</if>
|
|
<if test="moldName != null and moldName != ''">mold_name = #{moldName},</if>
|
|
<if test="productCode != null">product_code = #{productCode},</if>
|
|
<if test="productName != null">product_name = #{productName},</if>
|
|
<if test="specification != null">specification = #{specification},</if>
|
|
<if test="material != null">material = #{material},</if>
|
|
<if test="designLife != null">design_life = #{designLife},</if>
|
|
<if test="useLife != null">use_life = #{useLife},</if>
|
|
<if test="moldType != null">mold_type = #{moldType},</if>
|
|
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
|
<if test="productionDate != null">production_date = #{productionDate},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where mold_id = #{moldId}
|
|
</update>
|
|
|
|
<delete id="deleteMoldInfoByMoldId" parameterType="Long">
|
|
delete from mold_info where mold_id = #{moldId}
|
|
</delete>
|
|
|
|
<delete id="deleteMoldInfoByMoldIds" parameterType="String">
|
|
delete from mold_info where mold_id in
|
|
<foreach item="moldId" collection="array" open="(" separator="," close=")">
|
|
#{moldId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |