110 lines
5.5 KiB
XML
110 lines
5.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.neu.carbon.wms.mapper.WmsMaterialInfoMapper">
|
|
|
|
<resultMap type="WmsMaterialInfo" id="WmsMaterialInfoResult">
|
|
<result property="id" column="id" />
|
|
<result property="categoryId" column="category_id" />
|
|
<result property="code" column="code" />
|
|
<result property="name" column="name" />
|
|
<result property="model" column="model" />
|
|
<result property="specification" column="specification" />
|
|
<result property="unit" column="unit" />
|
|
<result property="price" column="price" />
|
|
<result property="type" column="type" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectWmsMaterialInfoVo">
|
|
select id, category_id, code, name, model, specification, unit, price, type, remark, create_by, create_time, update_by, update_time from wms_material_info
|
|
</sql>
|
|
|
|
<select id="selectWmsMaterialInfoList" parameterType="WmsMaterialInfo" resultMap="WmsMaterialInfoResult">
|
|
<include refid="selectWmsMaterialInfoVo"/>
|
|
<where>
|
|
<if test="categoryId != null "> and category_id = #{categoryId}</if>
|
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
<if test="model != null and model != ''"> and model like concat('%', #{model}, '%')</if>
|
|
<if test="specification != null and specification != ''"> and specification like concat('%', #{specification}, '%')</if>
|
|
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectWmsMaterialInfoById" parameterType="Long" resultMap="WmsMaterialInfoResult">
|
|
<include refid="selectWmsMaterialInfoVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertWmsMaterialInfo" parameterType="WmsMaterialInfo" useGeneratedKeys="true" keyProperty="id">
|
|
insert into wms_material_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="categoryId != null">category_id,</if>
|
|
<if test="code != null">code,</if>
|
|
<if test="name != null">name,</if>
|
|
<if test="model != null">model,</if>
|
|
<if test="specification != null">specification,</if>
|
|
<if test="unit != null">unit,</if>
|
|
<if test="price != null">price,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="remark != null">remark,</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>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="categoryId != null">#{categoryId},</if>
|
|
<if test="code != null">#{code},</if>
|
|
<if test="name != null">#{name},</if>
|
|
<if test="model != null">#{model},</if>
|
|
<if test="specification != null">#{specification},</if>
|
|
<if test="unit != null">#{unit},</if>
|
|
<if test="price != null">#{price},</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="remark != null">#{remark},</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>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateWmsMaterialInfo" parameterType="WmsMaterialInfo">
|
|
update wms_material_info
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="categoryId != null">category_id = #{categoryId},</if>
|
|
<if test="code != null">code = #{code},</if>
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="model != null">model = #{model},</if>
|
|
<if test="specification != null">specification = #{specification},</if>
|
|
<if test="unit != null">unit = #{unit},</if>
|
|
<if test="price != null">price = #{price},</if>
|
|
<if test="type != null">type = #{type},</if>
|
|
<if test="remark != null">remark = #{remark},</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>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteWmsMaterialInfoById" parameterType="Long">
|
|
delete from wms_material_info where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteWmsMaterialInfoByIds" parameterType="String">
|
|
delete from wms_material_info where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |