225 lines
13 KiB
XML
225 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.EmisWarehouseInMapper">
|
|
|
|
<resultMap type="EmisWarehouseIn" id="BaseEmisWarehouseInResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="serialNo" column="serial_no" />
|
|
<result property="inNo" column="in_no" />
|
|
<result property="orderSn" column="order_sn" />
|
|
<result property="billCode" column="bill_code" />
|
|
<result property="customerCode" column="customer_code" />
|
|
<result property="customerName" column="customer_name" />
|
|
<result property="entryDate" column="entry_date" />
|
|
<result property="confirmStatus" column="confirm_status" />
|
|
<result property="confirmDate" column="confirm_date" />
|
|
<result property="usedStatus" column="used_status" />
|
|
<result property="status" column="status" />
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="EmisWarehouseInResult" type="EmisWarehouseIn" extends="BaseEmisWarehouseInResult" >
|
|
<association property="waybillDetail"
|
|
column="bill_code"
|
|
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
|
|
fetchType="lazy"
|
|
/>
|
|
|
|
</resultMap>
|
|
|
|
<resultMap id="EmisWarehouseInDetailResult" type="EmisWarehouseIn" extends="BaseEmisWarehouseInResult" >
|
|
<association property="waybillDetail"
|
|
column="bill_code"
|
|
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
|
|
fetchType="lazy"
|
|
/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- <resultMap id="EmisWarehouseInDetailWithBatchListResult" type="EmisWarehouseIn" extends="BaseEmisWarehouseInResult" >-->
|
|
<!-- <association property="stockInBatchList"-->
|
|
<!-- column="in_no"-->
|
|
<!-- select="com.xdadan.erp.emis.mapper.EmisWarehouseInBatchMapper.selectInBatchListByInNo"-->
|
|
<!-- fetchType="lazy"-->
|
|
<!-- />-->
|
|
<!-- </resultMap>-->
|
|
|
|
|
|
<sql id="selectEmisWarehouseInVo">
|
|
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_warehouse_in
|
|
</sql>
|
|
|
|
<select id="selectEmisWarehouseInList" parameterType="EmisWarehouseIn" resultMap="EmisWarehouseInResult">
|
|
<include refid="selectEmisWarehouseInVo"/>
|
|
<where>
|
|
del_flag='0'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="serialNo != null and serialNo != ''"> and serial_no like concat('%', #{serialNo}, '%')</if>
|
|
<if test="inNo != null and inNo != ''">
|
|
and ( FIND_IN_SET(`in_no`,#{inNo}) or in_no like concat('%', #{inNo}, '%') )
|
|
</if>
|
|
<if test="orderSn != null and orderSn != ''"> and order_sn like concat('%', #{orderSn}, '%')</if>
|
|
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
|
|
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="entryDate != null "> and entry_date = #{entryDate}</if>
|
|
<if test="confirmStatus != null and confirmStatus != ''"> and confirm_status=#{confirmStatus}</if>
|
|
<if test="confirmDate != null "> and confirm_date = #{confirmDate}</if>
|
|
|
|
<if test="status != null and status != ''"> and status=#{status}</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>
|
|
|
|
<if test="usedStatus != null and usedStatus == 1">
|
|
and used_status= '1'
|
|
</if>
|
|
|
|
<if test="usedStatus != null and usedStatus == 0">
|
|
and used_status= '0'
|
|
</if>
|
|
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectEmisWarehouseInById" parameterType="Long" resultMap="EmisWarehouseInResult">
|
|
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_warehouse_in a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<select id="selectEmisWarehouseInByInNo" parameterType="String" resultMap="EmisWarehouseInResult">
|
|
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_warehouse_in a
|
|
where a.in_no = #{inNo}
|
|
</select>
|
|
|
|
<insert id="insertEmisWarehouseIn" parameterType="EmisWarehouseIn" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_warehouse_in
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="serialNo != null and serialNo != ''">serial_no,</if>
|
|
<if test="inNo != null and inNo != ''">in_no,</if>
|
|
<if test="orderSn != null and orderSn != ''">order_sn,</if>
|
|
<if test="billCode != null and billCode != ''">bill_code,</if>
|
|
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
|
<if test="customerName != null and customerName != ''">customer_name,</if>
|
|
<if test="entryDate != null">entry_date,</if>
|
|
<if test="confirmStatus != null and confirmStatus != ''">confirm_status,</if>
|
|
<if test="confirmDate != null">confirm_date,</if>
|
|
<if test="usedStatus != null and usedStatus != ''">used_status,</if>
|
|
<if test="status != null and status != ''">status,</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="serialNo != null and serialNo != ''">#{serialNo},</if>
|
|
<if test="inNo != null and inNo != ''">#{inNo},</if>
|
|
<if test="orderSn != null and orderSn != ''">#{orderSn},</if>
|
|
<if test="billCode != null and billCode != ''">#{billCode},</if>
|
|
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
|
<if test="entryDate != null">#{entryDate},</if>
|
|
<if test="confirmStatus != null and confirmStatus != ''">#{confirmStatus},</if>
|
|
<if test="confirmDate != null">#{confirmDate},</if>
|
|
<if test="usedStatus != null and usedStatus != ''">#{usedStatus},</if>
|
|
<if test="status != null and status != ''">#{status},</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="updateEmisWarehouseIn" parameterType="EmisWarehouseIn">
|
|
update emis_warehouse_in
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="serialNo != null and serialNo != ''">serial_no = #{serialNo},</if>
|
|
<if test="inNo != null and inNo != ''">in_no = #{inNo},</if>
|
|
<if test="orderSn != null and orderSn != ''">order_sn = #{orderSn},</if>
|
|
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
|
|
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
|
<if test="entryDate != null">entry_date = #{entryDate},</if>
|
|
<if test="confirmStatus != null and confirmStatus != ''">confirm_status = #{confirmStatus},</if>
|
|
<if test="confirmDate != null">confirm_date = #{confirmDate},</if>
|
|
<if test="usedStatus != null and usedStatus != ''">used_status = #{usedStatus},</if>
|
|
<if test="status != null and status != ''">status = #{status},</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>
|
|
|
|
<update id="changeUseStatusByUse" parameterType="EmisWarehouseIn">
|
|
update emis_warehouse_in
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bill_code = #{billCode},
|
|
used_status ='1',
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where in_no = #{inNo}
|
|
</update>
|
|
|
|
<update id="changeUseStatusByUnUse" parameterType="EmisWarehouseIn">
|
|
update emis_warehouse_in
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
bill_code =null,
|
|
used_status ='0',
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where in_no = #{inNo}
|
|
</update>
|
|
|
|
|
|
|
|
<update id="useInNo" parameterType="EmisWarehouseIn">
|
|
update emis_warehouse_in set used_status='1'
|
|
where bill_code = #{billCode} and in_no = #{inNo}
|
|
</update>
|
|
|
|
<delete id="deleteEmisWarehouseInById" parameterType="Long">
|
|
delete from emis_warehouse_in where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisWarehouseInByIds" parameterType="String">
|
|
delete from emis_warehouse_in where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |