116 lines
7.4 KiB
XML
116 lines
7.4 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.EmisTransLineMapper">
|
||
|
|
|
||
|
|
<resultMap type="EmisTransLine" id="EmisTransLineResult">
|
||
|
|
<result property="id" column="id" />
|
||
|
|
<result property="lineCode" column="line_code" />
|
||
|
|
<result property="lineName" column="line_name" />
|
||
|
|
<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" />
|
||
|
|
<result property="country" column="country" />
|
||
|
|
<result property="applyScope" column="apply_scope" />
|
||
|
|
<result property="logoType" column="logo_type" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectEmisTransLineVo">
|
||
|
|
select id, line_code, line_name, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, country, apply_scope, logo_type from emis_trans_line
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectEmisTransLineList" parameterType="EmisTransLine" resultMap="EmisTransLineResult">
|
||
|
|
<include refid="selectEmisTransLineVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="id != null "> and id = #{id}</if>
|
||
|
|
<if test="lineCode != null and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
|
||
|
|
<if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
|
||
|
|
<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>
|
||
|
|
<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>
|
||
|
|
<if test="logoType != null and logoType != ''"> and logo_type like concat('%', #{logoType}, '%')</if>
|
||
|
|
</where>
|
||
|
|
order by create_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectEmisTransLineById" parameterType="Long" resultMap="EmisTransLineResult">
|
||
|
|
select id, line_code, line_name, status, site_audit_man, site_audit_man_code, market_man, market_man_code, operate_man, operate_man_code, country, apply_scope, logo_type
|
||
|
|
from emis_trans_line a
|
||
|
|
where a.id = #{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<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>
|
||
|
|
<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>
|
||
|
|
<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>
|
||
|
|
</trim>
|
||
|
|
<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>
|
||
|
|
<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>
|
||
|
|
<if test="country != null and country != ''">#{country},</if>
|
||
|
|
<if test="applyScope != null and applyScope != ''">#{applyScope},</if>
|
||
|
|
<if test="logoType != null and logoType != ''">#{logoType},</if>
|
||
|
|
</trim>
|
||
|
|
</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>
|
||
|
|
<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>
|
||
|
|
<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>
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteEmisTransLineById" parameterType="Long">
|
||
|
|
delete from emis_trans_line where id = #{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteEmisTransLineByIds" parameterType="String">
|
||
|
|
delete from emis_trans_line where id in
|
||
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
|
#{id}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|