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

185 lines
13 KiB
XML
Raw Normal View History

2023-12-14 13:08:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
2023-12-26 12:31:35 +00:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2023-12-14 13:08:36 +00:00
<mapper namespace="com.xdadan.erp.emis.mapper.EmisTransLineMapper">
2023-12-26 12:31:35 +00:00
2024-06-02 02:57:46 +00:00
<resultMap type="EmisTransLine" id="EmisTransLineResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
2023-12-14 13:08:36 +00:00
<result property="id" column="id" />
<result property="lineCode" column="line_code" />
<result property="lineName" column="line_name" />
2024-04-16 13:26:15 +00:00
<result property="lineNameEn" column="line_name_en" />
<result property="meterRate" column="meter_rate" />
2023-12-14 13:08:36 +00:00
<result property="status" column="status" />
<result property="siteAuditMan" column="site_audit_man" />
<result property="siteAuditManCode" column="site_audit_man_code" />
<result property="marketMan" column="market_man" />
<result property="marketManCode" column="market_man_code" />
<result property="operateMan" column="operate_man" />
<result property="operateManCode" column="operate_man_code" />
2023-12-26 12:31:35 +00:00
<result property="fromCountry" column="from_country" />
2023-12-14 13:08:36 +00:00
<result property="country" column="country" />
<result property="applyScope" column="apply_scope" />
<result property="logoType" column="logo_type" />
2023-12-26 12:31:35 +00:00
<result property="transType" column="trans_type" />
2024-05-11 08:04:21 +00:00
<result property="orderNum" column="order_num" />
2024-04-16 08:02:35 +00:00
2024-06-02 01:10:24 +00:00
<association property="fromCountryName" column="from_country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
<association property="countryName" column="country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
<association property="logoTypeName" column="logo_type" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBrandNameByCode"/>
2024-05-11 11:07:36 +00:00
2024-04-16 08:02:35 +00:00
2023-12-14 13:08:36 +00:00
</resultMap>
2024-04-16 08:02:35 +00:00
2024-05-11 08:04:21 +00:00
<sql id="selectEmisTransLineVo">
select id, line_code, line_name, line_name_en, meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_trans_line
</sql>
2023-12-14 13:08:36 +00:00
<select id="selectEmisTransLineList" parameterType="EmisTransLine" resultMap="EmisTransLineResult">
<include refid="selectEmisTransLineVo"/>
2023-12-26 12:31:35 +00:00
<where>
2024-05-11 08:04:21 +00:00
del_flag = '0'
2023-12-14 13:08:36 +00:00
<if test="id != null "> and id = #{id}</if>
2024-05-11 08:04:21 +00:00
<if test="lineCode != null and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
2023-12-14 13:08:36 +00:00
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
2024-04-16 13:26:15 +00:00
<if test="lineNameEn != null and lineNameEn != ''"> and line_name_en like concat('%', #{lineNameEn}, '%')</if>
<if test="meterRate != null and meterRate != ''"> and meter_rate like concat('%', #{meterRate}, '%')</if>
2023-12-14 13:08:36 +00:00
<if test="status != null "> and status = #{status}</if>
<if test="siteAuditMan != null and siteAuditMan != ''"> and site_audit_man like concat('%', #{siteAuditMan}, '%')</if>
<if test="siteAuditManCode != null and siteAuditManCode != ''"> and site_audit_man_code like concat('%', #{siteAuditManCode}, '%')</if>
<if test="marketMan != null and marketMan != ''"> and market_man like concat('%', #{marketMan}, '%')</if>
<if test="marketManCode != null and marketManCode != ''"> and market_man_code like concat('%', #{marketManCode}, '%')</if>
<if test="operateMan != null and operateMan != ''"> and operate_man like concat('%', #{operateMan}, '%')</if>
<if test="operateManCode != null and operateManCode != ''"> and operate_man_code like concat('%', #{operateManCode}, '%')</if>
2023-12-26 12:31:35 +00:00
<if test="fromCountry != null and fromCountry != ''"> and from_country like concat('%', #{fromCountry}, '%')</if>
2023-12-14 13:08:36 +00:00
<if test="country != null and country != ''"> and country like concat('%', #{country}, '%')</if>
<if test="applyScope != null and applyScope != ''"> and apply_scope like concat('%', #{applyScope}, '%')</if>
2024-05-11 11:29:37 +00:00
<if test="logoType != null and logoType != ''"> and logo_type=#{logoType}</if>
2023-12-26 12:31:35 +00:00
<if test="transType != null and transType != ''"> and trans_type like concat('%', #{transType}, '%')</if>
2024-05-11 08:04:21 +00:00
<if test="orderNum != null "> and order_num = #{orderNum}</if>
2023-12-26 12:31:35 +00:00
<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-05-11 08:04:21 +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>
2023-12-14 13:08:36 +00:00
</where>
2024-05-11 09:04:09 +00:00
order by order_num desc
2023-12-14 13:08:36 +00:00
</select>
2023-12-26 12:31:35 +00:00
2023-12-14 13:08:36 +00:00
<select id="selectEmisTransLineById" parameterType="Long" resultMap="EmisTransLineResult">
2024-05-11 08:04:21 +00:00
select id, line_code, line_name, line_name_en, meter_rate, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, from_country, country, apply_scope, logo_type, trans_type, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
2023-12-14 13:08:36 +00:00
from emis_trans_line a
where a.id = #{id}
</select>
2023-12-26 12:31:35 +00:00
2023-12-14 13:08:36 +00:00
<insert id="insertEmisTransLine" parameterType="EmisTransLine">
insert into emis_trans_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="lineCode != null and lineCode != ''">line_code,</if>
<if test="lineName != null and lineName != ''">line_name,</if>
2024-04-16 13:26:15 +00:00
<if test="lineNameEn != null and lineNameEn != ''">line_name_en,</if>
<if test="meterRate != null and meterRate != ''">meter_rate,</if>
2023-12-14 13:08:36 +00:00
<if test="status != null">status,</if>
<if test="siteAuditMan != null and siteAuditMan != ''">site_audit_man,</if>
<if test="siteAuditManCode != null and siteAuditManCode != ''">site_audit_man_code,</if>
<if test="marketMan != null and marketMan != ''">market_man,</if>
<if test="marketManCode != null and marketManCode != ''">market_man_code,</if>
<if test="operateMan != null and operateMan != ''">operate_man,</if>
<if test="operateManCode != null and operateManCode != ''">operate_man_code,</if>
2023-12-26 12:31:35 +00:00
<if test="fromCountry != null and fromCountry != ''">from_country,</if>
2023-12-14 13:08:36 +00:00
<if test="country != null and country != ''">country,</if>
<if test="applyScope != null and applyScope != ''">apply_scope,</if>
<if test="logoType != null and logoType != ''">logo_type,</if>
2023-12-26 12:31:35 +00:00
<if test="transType != null and transType != ''">trans_type,</if>
2024-05-11 08:04:21 +00:00
<if test="orderNum != null">order_num,</if>
2023-12-26 12:31:35 +00:00
<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-05-11 08:04:21 +00:00
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
2023-12-26 12:31:35 +00:00
</trim>
2023-12-14 13:08:36 +00:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="lineCode != null and lineCode != ''">#{lineCode},</if>
<if test="lineName != null and lineName != ''">#{lineName},</if>
2024-04-16 13:26:15 +00:00
<if test="lineNameEn != null and lineNameEn != ''">#{lineNameEn},</if>
<if test="meterRate != null and meterRate != ''">#{meterRate},</if>
2023-12-14 13:08:36 +00:00
<if test="status != null">#{status},</if>
<if test="siteAuditMan != null and siteAuditMan != ''">#{siteAuditMan},</if>
<if test="siteAuditManCode != null and siteAuditManCode != ''">#{siteAuditManCode},</if>
<if test="marketMan != null and marketMan != ''">#{marketMan},</if>
<if test="marketManCode != null and marketManCode != ''">#{marketManCode},</if>
<if test="operateMan != null and operateMan != ''">#{operateMan},</if>
<if test="operateManCode != null and operateManCode != ''">#{operateManCode},</if>
2023-12-26 12:31:35 +00:00
<if test="fromCountry != null and fromCountry != ''">#{fromCountry},</if>
2023-12-14 13:08:36 +00:00
<if test="country != null and country != ''">#{country},</if>
<if test="applyScope != null and applyScope != ''">#{applyScope},</if>
<if test="logoType != null and logoType != ''">#{logoType},</if>
2023-12-26 12:31:35 +00:00
<if test="transType != null and transType != ''">#{transType},</if>
2024-05-11 08:04:21 +00:00
<if test="orderNum != null">#{orderNum},</if>
2023-12-26 12:31:35 +00:00
<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-05-11 08:04:21 +00:00
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
2023-12-26 12:31:35 +00:00
</trim>
2023-12-14 13:08:36 +00:00
</insert>
<update id="updateEmisTransLine" parameterType="EmisTransLine">
update emis_trans_line
<trim prefix="SET" suffixOverrides=",">
<if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if>
<if test="lineName != null and lineName != ''">line_name = #{lineName},</if>
2024-04-16 13:26:15 +00:00
<if test="lineNameEn != null and lineNameEn != ''">line_name_en = #{lineNameEn},</if>
<if test="meterRate != null and meterRate != ''">meter_rate = #{meterRate},</if>
2023-12-14 13:08:36 +00:00
<if test="status != null">status = #{status},</if>
<if test="siteAuditMan != null and siteAuditMan != ''">site_audit_man = #{siteAuditMan},</if>
<if test="siteAuditManCode != null and siteAuditManCode != ''">site_audit_man_code = #{siteAuditManCode},</if>
<if test="marketMan != null and marketMan != ''">market_man = #{marketMan},</if>
<if test="marketManCode != null and marketManCode != ''">market_man_code = #{marketManCode},</if>
<if test="operateMan != null and operateMan != ''">operate_man = #{operateMan},</if>
<if test="operateManCode != null and operateManCode != ''">operate_man_code = #{operateManCode},</if>
2023-12-26 12:31:35 +00:00
<if test="fromCountry != null and fromCountry != ''">from_country = #{fromCountry},</if>
2023-12-14 13:08:36 +00:00
<if test="country != null and country != ''">country = #{country},</if>
<if test="applyScope != null and applyScope != ''">apply_scope = #{applyScope},</if>
<if test="logoType != null and logoType != ''">logo_type = #{logoType},</if>
2023-12-26 12:31:35 +00:00
<if test="transType != null and transType != ''">trans_type = #{transType},</if>
2024-05-11 08:04:21 +00:00
<if test="orderNum != null">order_num = #{orderNum},</if>
2023-12-26 12:31:35 +00:00
<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-05-11 08:04:21 +00:00
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
2023-12-14 13:08:36 +00:00
</trim>
where id = #{id}
</update>
<delete id="deleteEmisTransLineById" parameterType="Long">
2024-05-11 08:04:21 +00:00
update emis_trans_line set del_flag='1' where id = #{id}
2023-12-14 13:08:36 +00:00
</delete>
<delete id="deleteEmisTransLineByIds" parameterType="String">
2024-05-11 08:04:21 +00:00
update emis_trans_line set del_flag='1' where id in
2023-12-14 13:08:36 +00:00
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>