2024-01-10 07:34:37 +00:00
<?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.EmisNotCalcAgingMapper" >
<resultMap type= "EmisNotCalcAging" id= "EmisNotCalcAgingResult" >
<result property= "id" column= "id" />
<result property= "country" column= "country" />
2024-01-11 06:13:38 +00:00
<result property= "noCalcDay" column= "no_calc_day" />
2024-01-10 07:34:37 +00:00
<result property= "status" column= "status" />
<result property= "remark" column= "remark" />
<result property= "tenantId" column= "tenant_id" />
<result property= "delFlag" column= "del_flag" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
2024-04-18 00:56:42 +00:00
<result property= "createSite" column= "create_site" />
<result property= "updateSite" column= "update_site" />
<association property= "countryName" column= "country" select= "selectGroupCountryNameByCode" />
2024-01-10 07:34:37 +00:00
</resultMap>
<sql id= "selectEmisNotCalcAgingVo" >
2024-04-18 00:56:42 +00:00
select id, country, country_name, no_calc_day, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_not_calc_aging
2024-01-10 07:34:37 +00:00
</sql>
2024-04-18 00:56:42 +00:00
<select id= "selectGroupCountryNameByCode" parameterType= "String" resultType= "string" >
select GROUP_CONCAT(name) from emis_country where FIND_IN_SET(`code`,#{code})
</select>
2024-04-30 04:18:11 +00:00
<select id= "getNotCalcAgingDays" resultType= "integer" >
2024-04-28 16:08:11 +00:00
select count(1) from emis_not_calc_aging where ( FIND_IN_SET('-1',country) or FIND_IN_SET(#{recieveCountry},country) or FIND_IN_SET(#{sendCountry},country) ) and no_calc_day <![CDATA[ >= ]]> #{startDate} and no_calc_day <![CDATA[ <= ]]> #{endDate}
</select>
2024-04-18 00:56:42 +00:00
2024-01-10 07:34:37 +00:00
<select id= "selectEmisNotCalcAgingList" parameterType= "EmisNotCalcAging" resultMap= "EmisNotCalcAgingResult" >
<include refid= "selectEmisNotCalcAgingVo" />
<where >
<if test= "id != null " > and id = #{id}</if>
2024-04-18 00:56:42 +00:00
<if test= "countryName != null and countryName != ''" > and country_name like concat('%', #{countryName}, '%')</if>
2024-01-10 07:34:37 +00:00
<if test= "status != null " > 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>
2024-04-18 00:56:42 +00:00
<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>
2024-05-12 15:32:50 +00:00
<!-- <if test="noCalcDay != null "> and no_calc_day = #{noCalcDay}</if> -->
<if test= "country != null and country != ''" > and (country = #{country} or country='-1')</if>
<if test= "params.beginNoCalcDay != null and params.beginNoCalcDay != ''" >
and no_calc_day <![CDATA[ >= ]]> #{params.beginNoCalcDay}
</if>
<if test= "params.endNoCalcDay != null and params.endNoCalcDay != ''" >
and no_calc_day <![CDATA[ <= ]]> #{params.endNoCalcDay}
</if>
2024-01-10 07:34:37 +00:00
</where>
order by create_time desc
</select>
<select id= "selectEmisNotCalcAgingById" parameterType= "Long" resultMap= "EmisNotCalcAgingResult" >
2024-04-18 00:56:42 +00:00
select id, country, country_name, no_calc_day, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
2024-01-10 07:34:37 +00:00
from emis_not_calc_aging a
where a.id = #{id}
</select>
<insert id= "insertEmisNotCalcAging" parameterType= "EmisNotCalcAging" >
insert into emis_not_calc_aging
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > id,</if>
<if test= "country != null and country != ''" > country,</if>
2024-04-18 00:56:42 +00:00
<if test= "countryName != null and countryName != ''" > country_name,</if>
2024-01-11 06:13:38 +00:00
<if test= "noCalcDay != null" > no_calc_day,</if>
2024-01-10 07:34:37 +00:00
<if test= "status != null" > 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>
2024-04-18 00:56:42 +00:00
<if test= "createSite != null and createSite != ''" > create_site,</if>
<if test= "updateSite != null and updateSite != ''" > update_site,</if>
2024-01-10 07:34:37 +00:00
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > #{id},</if>
<if test= "country != null and country != ''" > #{country},</if>
2024-04-18 00:56:42 +00:00
<if test= "countryName != null and countryName != ''" > #{countryName},</if>
2024-01-11 06:13:38 +00:00
<if test= "noCalcDay != null" > #{noCalcDay},</if>
2024-01-10 07:34:37 +00:00
<if test= "status != null" > #{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>
2024-04-18 00:56:42 +00:00
<if test= "createSite != null and createSite != ''" > #{createSite},</if>
<if test= "updateSite != null and updateSite != ''" > #{updateSite},</if>
2024-01-10 07:34:37 +00:00
</trim>
</insert>
<update id= "updateEmisNotCalcAging" parameterType= "EmisNotCalcAging" >
update emis_not_calc_aging
<trim prefix= "SET" suffixOverrides= "," >
<if test= "country != null and country != ''" > country = #{country},</if>
2024-04-18 00:56:42 +00:00
<if test= "countryName != null and countryName != ''" > country_name = #{countryName},</if>
2024-01-11 06:13:38 +00:00
<if test= "noCalcDay != null" > no_calc_day = #{noCalcDay},</if>
2024-01-10 07:34:37 +00:00
<if test= "status != null" > 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>
2024-04-18 00:56:42 +00:00
<if test= "createSite != null and createSite != ''" > create_site = #{createSite},</if>
<if test= "updateSite != null and updateSite != ''" > update_site = #{updateSite},</if>
2024-01-10 07:34:37 +00:00
</trim>
where id = #{id}
</update>
<delete id= "deleteEmisNotCalcAgingById" parameterType= "Long" >
delete from emis_not_calc_aging where id = #{id}
</delete>
<delete id= "deleteEmisNotCalcAgingByIds" parameterType= "String" >
delete from emis_not_calc_aging where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>