emis-service/emis-biz/src/main/resources/mapper/EmisWaybillComplaintsMapper.xml
2024-08-29 18:28:17 +08:00

188 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.EmisWaybillComplaintsMapper">
<resultMap type="EmisWaybillComplaints" id="EmisWaybillComplaintsResult">
<result property="id" column="id" />
<result property="billCode" column="bill_code" />
<result property="cpSiteCode" column="cp_site_code" />
<result property="cpReason" column="cp_reason" />
<result property="dataFrom" column="data_from" />
<result property="blReversion" column="bl_reversion" />
<result property="reversionStr" column="reversion_str" />
<result property="reversionMan" column="reversion_man" />
<result property="reversionManCode" column="reversion_man_code" />
<result property="reversionSiteCode" column="reversion_site_code" />
<result property="reversionDate" column="reversion_date" />
<result property="blCheckok" column="bl_checkok" />
<result property="dealResult" column="deal_result" />
<result property="blSee" column="bl_see" />
<result property="filePath" column="file_path" />
</resultMap>
<sql id="selectEmisWaybillComplaintsVo">
select id, bill_code, cp_site_code, cp_reason, data_from, bl_reversion, reversion_str, reversion_man, reversion_man_code, reversion_site_code, reversion_date, bl_checkok, deal_result, remark, bl_see, file_path, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_waybill_complaints
</sql>
<select id="selectEmisWaybillComplaintsList" parameterType="EmisWaybillComplaints" resultMap="EmisWaybillComplaintsResult">
<include refid="selectEmisWaybillComplaintsVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</if>
<if test="cpSiteCode != null and cpSiteCode != ''"> and cp_site_code like concat('%', #{cpSiteCode}, '%')</if>
<if test="cpReason != null and cpReason != ''"> and cp_reason like concat('%', #{cpReason}, '%')</if>
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="blReversion != null and blReversion != ''"> and bl_reversion like concat('%', #{blReversion}, '%')</if>
<if test="reversionStr != null and reversionStr != ''"> and reversion_str like concat('%', #{reversionStr}, '%')</if>
<if test="reversionMan != null and reversionMan != ''"> and reversion_man like concat('%', #{reversionMan}, '%')</if>
<if test="reversionManCode != null and reversionManCode != ''"> and reversion_man_code like concat('%', #{reversionManCode}, '%')</if>
<if test="reversionSiteCode != null and reversionSiteCode != ''"> and reversion_site_code like concat('%', #{reversionSiteCode}, '%')</if>
<if test="reversionDate != null "> and reversion_date = #{reversionDate}</if>
<if test="blCheckok != null and blCheckok != ''"> and bl_checkok like concat('%', #{blCheckok}, '%')</if>
<if test="dealResult != null and dealResult != ''"> and deal_result like concat('%', #{dealResult}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="blSee != null and blSee != ''"> and bl_see like concat('%', #{blSee}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path like concat('%', #{filePath}, '%')</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="EmisWaybillComplaints" resultType="int">
select count(1) from emis_waybill_complaints
where del_flag='0'
and id = #{id}
and bill_code = #{billCode}
and cp_site_code = #{cpSiteCode}
and cp_reason = #{cpReason}
and data_from = #{dataFrom}
and bl_reversion = #{blReversion}
and reversion_str = #{reversionStr}
and reversion_man = #{reversionMan}
and reversion_man_code = #{reversionManCode}
and reversion_site_code = #{reversionSiteCode}
and reversion_date = #{reversionDate}
and bl_checkok = #{blCheckok}
and deal_result = #{dealResult}
and remark = #{remark}
and bl_see = #{blSee}
and file_path = #{filePath}
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="selectEmisWaybillComplaintsById" parameterType="Long" resultMap="EmisWaybillComplaintsResult">
select id, bill_code, cp_site_code, cp_reason, data_from, bl_reversion, reversion_str, reversion_man, reversion_man_code, reversion_site_code, reversion_date, bl_checkok, deal_result, remark, bl_see, file_path, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_waybill_complaints a
where a.id = #{id}
</select>
<insert id="insertEmisWaybillComplaints" parameterType="EmisWaybillComplaints" useGeneratedKeys="true" keyProperty="id">
insert into emis_waybill_complaints
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="billCode != null and billCode != ''">bill_code,</if>
<if test="cpSiteCode != null and cpSiteCode != ''">cp_site_code,</if>
<if test="cpReason != null and cpReason != ''">cp_reason,</if>
<if test="dataFrom != null and dataFrom != ''">data_from,</if>
<if test="blReversion != null and blReversion != ''">bl_reversion,</if>
<if test="reversionStr != null and reversionStr != ''">reversion_str,</if>
<if test="reversionMan != null and reversionMan != ''">reversion_man,</if>
<if test="reversionManCode != null and reversionManCode != ''">reversion_man_code,</if>
<if test="reversionSiteCode != null and reversionSiteCode != ''">reversion_site_code,</if>
<if test="reversionDate != null">reversion_date,</if>
<if test="blCheckok != null and blCheckok != ''">bl_checkok,</if>
<if test="dealResult != null and dealResult != ''">deal_result,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="blSee != null and blSee != ''">bl_see,</if>
<if test="filePath != null and filePath != ''">file_path,</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="billCode != null and billCode != ''">#{billCode},</if>
<if test="cpSiteCode != null and cpSiteCode != ''">#{cpSiteCode},</if>
<if test="cpReason != null and cpReason != ''">#{cpReason},</if>
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</if>
<if test="blReversion != null and blReversion != ''">#{blReversion},</if>
<if test="reversionStr != null and reversionStr != ''">#{reversionStr},</if>
<if test="reversionMan != null and reversionMan != ''">#{reversionMan},</if>
<if test="reversionManCode != null and reversionManCode != ''">#{reversionManCode},</if>
<if test="reversionSiteCode != null and reversionSiteCode != ''">#{reversionSiteCode},</if>
<if test="reversionDate != null">#{reversionDate},</if>
<if test="blCheckok != null and blCheckok != ''">#{blCheckok},</if>
<if test="dealResult != null and dealResult != ''">#{dealResult},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="blSee != null and blSee != ''">#{blSee},</if>
<if test="filePath != null and filePath != ''">#{filePath},</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="updateEmisWaybillComplaints" parameterType="EmisWaybillComplaints">
update emis_waybill_complaints
<trim prefix="SET" suffixOverrides=",">
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="cpSiteCode != null and cpSiteCode != ''">cp_site_code = #{cpSiteCode},</if>
<if test="cpReason != null and cpReason != ''">cp_reason = #{cpReason},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="blReversion != null and blReversion != ''">bl_reversion = #{blReversion},</if>
<if test="reversionStr != null and reversionStr != ''">reversion_str = #{reversionStr},</if>
<if test="reversionMan != null and reversionMan != ''">reversion_man = #{reversionMan},</if>
<if test="reversionManCode != null and reversionManCode != ''">reversion_man_code = #{reversionManCode},</if>
<if test="reversionSiteCode != null and reversionSiteCode != ''">reversion_site_code = #{reversionSiteCode},</if>
<if test="reversionDate != null">reversion_date = #{reversionDate},</if>
<if test="blCheckok != null and blCheckok != ''">bl_checkok = #{blCheckok},</if>
<if test="dealResult != null and dealResult != ''">deal_result = #{dealResult},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="blSee != null and blSee != ''">bl_see = #{blSee},</if>
<if test="filePath != null and filePath != ''">file_path = #{filePath},</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="deleteEmisWaybillComplaintsById" parameterType="Long">
delete from emis_waybill_complaints where id = #{id}
</delete>
<delete id="deleteEmisWaybillComplaintsByIds" parameterType="String">
delete from emis_waybill_complaints where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>