|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.dgtly.sync.mapper.CustomersMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="Customers" id="CustomersResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="createBy" column="create_by" />
|
|
@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectCustomersList" parameterType="Customers" resultMap="CustomersResult">
|
|
|
<include refid="selectCustomersVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
<if test="chainsName != null and chainsName != ''"> and chains_name like concat('%', #{chainsName}, '%')</if>
|
|
|
<if test="chainsCode != null and chainsCode != ''"> and chains_code = #{chainsCode}</if>
|
|
@@ -47,12 +47,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="lineId != null and lineId != ''"> and line_id = #{lineId}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectCustomersById" parameterType="Long" resultMap="CustomersResult">
|
|
|
<include refid="selectCustomersVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertCustomers" parameterType="Customers" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into customers
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -124,22 +124,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCustomersByIds" parameterType="String">
|
|
|
- delete from customers where id in
|
|
|
+ delete from customers where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
<select id="selectCustomerMapByCode" resultMap="CustomersResult">
|
|
|
- select code ,chains_name,chains_code from customers where code is not null
|
|
|
+ SELECT MainCustomerCode as code,MainCustomerName as chains_name,MainCustomerCode as chains_code FROM data_master_customer where MainCustomerCode is not null;
|
|
|
</select>
|
|
|
<select id="selectCustomerMapByChainsCode" resultMap="CustomersResult">
|
|
|
- select chains_code ,chains_name from customers where chains_code is not null
|
|
|
+ SELECT MainCustomerCode as chains_code,MainCustomerName as chains_name FROM data_master_customer where MainCustomerCode is not null;
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCustomerNameByCustomerCode" resultType="java.lang.String">
|
|
|
- select chains_name from customers where 1=1
|
|
|
- <if test="customerCode !=null and customerCode !='' ">and chains_code =#{customerCode}</if>
|
|
|
+ select MainCustomerName from data_master_customer where 1=1
|
|
|
+ <if test="customerCode !=null and customerCode !='' ">and MainCustomerCode =#{customerCode}</if>
|
|
|
limit 1
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|