emis-service/emis-biz/src/main/resources/mapper/EmisCommissionExpressionMapper.xml

175 lines
11 KiB
XML
Raw Normal View History

2024-09-05 03:07:27 +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.EmisCommissionExpressionMapper">
<resultMap type="EmisCommissionExpression" id="EmisCommissionExpressionResult">
<result property="id" column="id" />
<result property="quoteId" column="quote_id" />
<result property="quoteSequence" column="quote_sequence" />
<result property="useSiteCode" column="use_site_code" />
<result property="useSite" column="use_site" />
<result property="startWeight" column="start_weight" />
<result property="endWeight" column="end_weight" />
<result property="initialWeight" column="initial_weight" />
<result property="additionalWeight" column="additional_weight" />
<result property="conditionExpression" column="condition_expression" />
<result property="calculateExpression" column="calculate_expression" />
<result property="status" column="status" />
</resultMap>
<sql id="selectEmisCommissionExpressionVo">
select id, quote_id, quote_sequence, use_site_code, use_site, start_weight, end_weight, initial_weight, additional_weight, condition_expression, calculate_expression, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_commission_expression
</sql>
<select id="selectEmisCommissionExpressionList" parameterType="EmisCommissionExpression" resultMap="EmisCommissionExpressionResult">
<include refid="selectEmisCommissionExpressionVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="quoteId != null "> and quote_id = #{quoteId}</if>
<if test="quoteSequence != null "> and quote_sequence = #{quoteSequence}</if>
<if test="useSiteCode != null and useSiteCode != ''"> and use_site_code like concat('%', #{useSiteCode}, '%')</if>
<if test="useSite != null and useSite != ''"> and use_site like concat('%', #{useSite}, '%')</if>
<if test="startWeight != null "> and start_weight = #{startWeight}</if>
<if test="endWeight != null "> and end_weight = #{endWeight}</if>
<if test="initialWeight != null "> and initial_weight = #{initialWeight}</if>
<if test="additionalWeight != null "> and additional_weight = #{additionalWeight}</if>
<if test="conditionExpression != null and conditionExpression != ''"> and condition_expression like concat('%', #{conditionExpression}, '%')</if>
<if test="calculateExpression != null and calculateExpression != ''"> and calculate_expression like concat('%', #{calculateExpression}, '%')</if>
<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>
<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="EmisCommissionExpression" resultType="int">
select count(1) from emis_commission_expression
where del_flag='0'
and id = #{id}
and quote_id = #{quoteId}
and quote_sequence = #{quoteSequence}
and use_site_code = #{useSiteCode}
and use_site = #{useSite}
and start_weight = #{startWeight}
and end_weight = #{endWeight}
and initial_weight = #{initialWeight}
and additional_weight = #{additionalWeight}
and condition_expression = #{conditionExpression}
and calculate_expression = #{calculateExpression}
and status = #{status}
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="selectEmisCommissionExpressionById" parameterType="Long" resultMap="EmisCommissionExpressionResult">
select id, quote_id, quote_sequence, use_site_code, use_site, start_weight, end_weight, initial_weight, additional_weight, condition_expression, calculate_expression, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_commission_expression a
where a.id = #{id}
</select>
<insert id="insertEmisCommissionExpression" parameterType="EmisCommissionExpression" useGeneratedKeys="true" keyProperty="id">
insert into emis_commission_expression
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="quoteId != null">quote_id,</if>
<if test="quoteSequence != null">quote_sequence,</if>
<if test="useSiteCode != null and useSiteCode != ''">use_site_code,</if>
<if test="useSite != null and useSite != ''">use_site,</if>
<if test="startWeight != null">start_weight,</if>
<if test="endWeight != null">end_weight,</if>
<if test="initialWeight != null">initial_weight,</if>
<if test="additionalWeight != null">additional_weight,</if>
<if test="conditionExpression != null and conditionExpression != ''">condition_expression,</if>
<if test="calculateExpression != null and calculateExpression != ''">calculate_expression,</if>
<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>
<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="quoteId != null">#{quoteId},</if>
<if test="quoteSequence != null">#{quoteSequence},</if>
<if test="useSiteCode != null and useSiteCode != ''">#{useSiteCode},</if>
<if test="useSite != null and useSite != ''">#{useSite},</if>
<if test="startWeight != null">#{startWeight},</if>
<if test="endWeight != null">#{endWeight},</if>
<if test="initialWeight != null">#{initialWeight},</if>
<if test="additionalWeight != null">#{additionalWeight},</if>
<if test="conditionExpression != null and conditionExpression != ''">#{conditionExpression},</if>
<if test="calculateExpression != null and calculateExpression != ''">#{calculateExpression},</if>
<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>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisCommissionExpression" parameterType="EmisCommissionExpression">
update emis_commission_expression
<trim prefix="SET" suffixOverrides=",">
<if test="quoteId != null">quote_id = #{quoteId},</if>
<if test="quoteSequence != null">quote_sequence = #{quoteSequence},</if>
<if test="useSiteCode != null and useSiteCode != ''">use_site_code = #{useSiteCode},</if>
<if test="useSite != null and useSite != ''">use_site = #{useSite},</if>
<if test="startWeight != null">start_weight = #{startWeight},</if>
<if test="endWeight != null">end_weight = #{endWeight},</if>
<if test="initialWeight != null">initial_weight = #{initialWeight},</if>
<if test="additionalWeight != null">additional_weight = #{additionalWeight},</if>
<if test="conditionExpression != null and conditionExpression != ''">condition_expression = #{conditionExpression},</if>
<if test="calculateExpression != null and calculateExpression != ''">calculate_expression = #{calculateExpression},</if>
<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>
<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="deleteEmisCommissionExpressionById" parameterType="Long">
delete from emis_commission_expression where id = #{id}
</delete>
<delete id="deleteEmisCommissionExpressionByIds" parameterType="String">
delete from emis_commission_expression where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>