integrated_traffic/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityCustomerMana...

116 lines
3.1 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.zcloud.mapper.datasource.comprehensive.TrafficSecurityCustomerManagementMapper">
<sql id="tableName">
BUS_TRAFFIC_CUSTOMER_MANAGEMENT
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!--字段 -->
<sql id="Field">
f.CUSTOMERMANAGEMENT_ID,
f.CUSTOMERTYPE,
f.CUSTOMERNAME,
f.TRANSPORTATIONCOMPANY,
f.ISDELETE,
f.DELETOR,
f.DELETORNAME,
f.DELETETIME,
f.CREATOR,
f.CREATORNAME,
f.CREATETIME,
f.OPERATOR,
f.OPERATORNAME,
f.CUSTOMERNAME_ID,
f.OPERATTIME
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CUSTOMERMANAGEMENT_ID,
CUSTOMERTYPE,
CUSTOMERNAME,
TRANSPORTATIONCOMPANY,
ISDELETE,
DELETOR,
DELETORNAME,
DELETETIME,
CREATOR,
CREATORNAME,
CREATETIME,
OPERATOR,
OPERATORNAME,
CUSTOMERNAME_ID,
OPERATTIME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CUSTOMERMANAGEMENT_ID},
#{CUSTOMERTYPE},
#{CUSTOMERNAME},
#{TRANSPORTATIONCOMPANY},
#{ISDELETE},
#{DELETOR},
#{DELETORNAME},
#{DELETETIME},
#{CREATOR},
#{CREATORNAME},
#{CREATETIME},
#{OPERATOR},
#{OPERATORNAME},
#{CUSTOMERNAME_ID},
#{OPERATTIME}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
DELETOR = #{DELETOR},
DELETETIME = #{DELETETIME}
where
CUSTOMERMANAGEMENT_ID = #{CUSTOMERMANAGEMENT_ID}
</delete>
<!--列表-->
<select id="datalistPage" parameterType="page" resultType="pd">
select
f.*,
i.CORP_NAME,
u.CONTACT,
u.CONTACT_ID,
u.CONTACTPHONE,
u.CUSTOMERADDRESS,
u.CUSTOMERADDRESS_ID
from
<include refid="tableName"></include> f
left join bus_corp_info i on f.TRANSPORTATIONCOMPANY = i.CORPINFO_ID
left join bus_traffic_customer_contact u on f.CUSTOMERMANAGEMENT_ID = u.CUSTOMERMANAGEMENT_ID
where f.ISDELETE = '0'
<if test="pd.CUSTOMERTYPE != null and pd.CUSTOMERTYPE != ''"><!-- 关键词检索-客户类型 -->
and f.CUSTOMERTYPE = #{pd.CUSTOMERTYPE}
</if>
<if test="pd.TRANSPORTATIONCOMPANY != null and pd.TRANSPORTATIONCOMPANY != ''"><!-- 关键词检索-运输企业 -->
and i.CORP_NAME = #{pd.TRANSPORTATIONCOMPANY}
</if>
</select>
</mapper>