207 lines
13 KiB
XML
207 lines
13 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.xdadan.erp.emis.mapper.EmisMaterialMapper" >
|
|
|
|
<resultMap type="EmisMaterial" id="EmisMaterialResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="materialCode" column="material_code" />
|
|
<result property="materialName" column="material_name" />
|
|
<result property="materialNameEn" column="material_name_en" />
|
|
<result property="blList" column="bl_list" />
|
|
<result property="unitNumber" column="unit_number" />
|
|
<result property="unitPrice" column="unit_price" />
|
|
<result property="stockPrice" column="stock_price" />
|
|
<result property="goodsUnit" column="goods_unit" />
|
|
<result property="quantity" column="quantity" />
|
|
<result property="alertNumber" column="alert_number" />
|
|
<result property="lowQuantity" column="low_quantity" />
|
|
<result property="blNeedbill" column="bl_needbill" />
|
|
<result property="blApply" column="bl_apply" />
|
|
<result property="blSend" column="bl_send" />
|
|
<result property="blEnable" column="bl_enable" />
|
|
<result property="orderNum" column="order_num" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisMaterialVo">
|
|
select id, material_code, material_name, material_name_en, bl_list, unit_number, unit_price, stock_price, goods_unit, quantity, alert_number, low_quantity, bl_needbill, bl_apply, bl_send, bl_enable, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_material
|
|
</sql>
|
|
|
|
<select id="selectEmisMaterialList" parameterType="EmisMaterial" resultMap="EmisMaterialResult">
|
|
<include refid="selectEmisMaterialVo"/>
|
|
<where>
|
|
del_flag='0'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
<if test="materialNameEn != null and materialNameEn != ''"> and material_name_en like concat('%', #{materialNameEn}, '%')</if>
|
|
<if test="blList != null and blList != ''"> and bl_list = #{blList}</if>
|
|
<if test="unitNumber != null "> and unit_number = #{unitNumber}</if>
|
|
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
|
<if test="stockPrice != null "> and stock_price = #{stockPrice}</if>
|
|
<if test="goodsUnit != null and goodsUnit != ''"> and goods_unit = #{goodsUnit}</if>
|
|
<if test="quantity != null "> and quantity = #{quantity}</if>
|
|
<if test="alertNumber != null "> and alert_number = #{alertNumber}</if>
|
|
<if test="lowQuantity != null "> and low_quantity = #{lowQuantity}</if>
|
|
<if test="blNeedbill != null and blNeedbill != ''"> and bl_needbill = #{blNeedbill}</if>
|
|
<if test="blApply != null and blApply != ''"> and bl_apply = #{blApply}</if>
|
|
<if test="blSend != null and blSend != ''"> and bl_send = #{blSend}</if>
|
|
<if test="blEnable != null and blEnable != ''"> and bl_enable = #{blEnable}</if>
|
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisMaterial" resultType="int">
|
|
select count(1) from emis_material
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and material_code = #{materialCode}
|
|
and material_name = #{materialName}
|
|
and material_name_en = #{materialNameEn}
|
|
and bl_list = #{blList}
|
|
and unit_number = #{unitNumber}
|
|
and unit_price = #{unitPrice}
|
|
and stock_price = #{stockPrice}
|
|
and goods_unit = #{goodsUnit}
|
|
and quantity = #{quantity}
|
|
and alert_number = #{alertNumber}
|
|
and low_quantity = #{lowQuantity}
|
|
and bl_needbill = #{blNeedbill}
|
|
and bl_apply = #{blApply}
|
|
and bl_send = #{blSend}
|
|
and bl_enable = #{blEnable}
|
|
and order_num = #{orderNum}
|
|
and remark = #{remark}
|
|
and tenant_id = #{tenantId}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisMaterialById" parameterType="Long" resultMap="EmisMaterialResult">
|
|
select id, material_code, material_name, material_name_en, bl_list, unit_number, unit_price, stock_price, goods_unit, quantity, alert_number, low_quantity, bl_needbill, bl_apply, bl_send, bl_enable, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_material a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisMaterial" parameterType="EmisMaterial" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_material
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
|
<if test="materialNameEn != null and materialNameEn != ''">material_name_en,</if>
|
|
<if test="blList != null and blList != ''">bl_list,</if>
|
|
<if test="unitNumber != null">unit_number,</if>
|
|
<if test="unitPrice != null">unit_price,</if>
|
|
<if test="stockPrice != null">stock_price,</if>
|
|
<if test="goodsUnit != null and goodsUnit != ''">goods_unit,</if>
|
|
<if test="quantity != null">quantity,</if>
|
|
<if test="alertNumber != null">alert_number,</if>
|
|
<if test="lowQuantity != null">low_quantity,</if>
|
|
<if test="blNeedbill != null and blNeedbill != ''">bl_needbill,</if>
|
|
<if test="blApply != null and blApply != ''">bl_apply,</if>
|
|
<if test="blSend != null and blSend != ''">bl_send,</if>
|
|
<if test="blEnable != null and blEnable != ''">bl_enable,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
|
<if test="materialNameEn != null and materialNameEn != ''">#{materialNameEn},</if>
|
|
<if test="blList != null and blList != ''">#{blList},</if>
|
|
<if test="unitNumber != null">#{unitNumber},</if>
|
|
<if test="unitPrice != null">#{unitPrice},</if>
|
|
<if test="stockPrice != null">#{stockPrice},</if>
|
|
<if test="goodsUnit != null and goodsUnit != ''">#{goodsUnit},</if>
|
|
<if test="quantity != null">#{quantity},</if>
|
|
<if test="alertNumber != null">#{alertNumber},</if>
|
|
<if test="lowQuantity != null">#{lowQuantity},</if>
|
|
<if test="blNeedbill != null and blNeedbill != ''">#{blNeedbill},</if>
|
|
<if test="blApply != null and blApply != ''">#{blApply},</if>
|
|
<if test="blSend != null and blSend != ''">#{blSend},</if>
|
|
<if test="blEnable != null and blEnable != ''">#{blEnable},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisMaterial" parameterType="EmisMaterial">
|
|
update emis_material
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
|
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
|
<if test="materialNameEn != null and materialNameEn != ''">material_name_en = #{materialNameEn},</if>
|
|
<if test="blList != null and blList != ''">bl_list = #{blList},</if>
|
|
<if test="unitNumber != null">unit_number = #{unitNumber},</if>
|
|
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
|
<if test="stockPrice != null">stock_price = #{stockPrice},</if>
|
|
<if test="goodsUnit != null and goodsUnit != ''">goods_unit = #{goodsUnit},</if>
|
|
<if test="quantity != null">quantity = #{quantity},</if>
|
|
<if test="alertNumber != null">alert_number = #{alertNumber},</if>
|
|
<if test="lowQuantity != null">low_quantity = #{lowQuantity},</if>
|
|
<if test="blNeedbill != null and blNeedbill != ''">bl_needbill = #{blNeedbill},</if>
|
|
<if test="blApply != null and blApply != ''">bl_apply = #{blApply},</if>
|
|
<if test="blSend != null and blSend != ''">bl_send = #{blSend},</if>
|
|
<if test="blEnable != null and blEnable != ''">bl_enable = #{blEnable},</if>
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisMaterialById" parameterType="Long">
|
|
delete from emis_material where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisMaterialByIds" parameterType="String">
|
|
delete from emis_material where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |