|
@@ -19,10 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="glsj" column="glsj" />
|
|
<result property="glsj" column="glsj" />
|
|
<result property="enddate" column="enddate" />
|
|
<result property="enddate" column="enddate" />
|
|
<result property="etlCreatetime" column="ETL_createtime" />
|
|
<result property="etlCreatetime" column="ETL_createtime" />
|
|
|
|
+ <result property="customerType" column="customer_type" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectAssRelcustomerinfoVo">
|
|
<sql id="selectAssRelcustomerinfoVo">
|
|
- select id, create_by, create_time, update_by, update_time, is_delete, mainkunnr, mainname1, kunnr, name1, glfs, glsj, enddate, ETL_createtime,user_id from ass_relcustomerinfo
|
|
|
|
|
|
+ select id, create_by, create_time, update_by, update_time, is_delete, mainkunnr, mainname1, kunnr, name1, glfs, glsj, enddate, ETL_createtime,user_id,customer_type from ass_relcustomerinfo
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectAssRelcustomerinfoList" parameterType="AssRelcustomerinfo" resultMap="AssRelcustomerinfoResult">
|
|
<select id="selectAssRelcustomerinfoList" parameterType="AssRelcustomerinfo" resultMap="AssRelcustomerinfoResult">
|
|
@@ -114,7 +115,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<insert id="relationCustomerOnlineSync">
|
|
<insert id="relationCustomerOnlineSync">
|
|
- INSERT INTO customers_start (customers_code, customers_name, online_time,customer_type)
|
|
|
|
|
|
+
|
|
|
|
+ insert into customers_start
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="mainkunnr != null and mainkunnr != ''">customers_code,</if>
|
|
|
|
+ <if test="mainname1 != null and mainname1 !='' ">customers_name,</if>
|
|
|
|
+ online_time,
|
|
|
|
+ <if test="customerType != null and customerType !='' ">customer_type,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="mainkunnr != null and mainkunnr != ''">#{mainkunnr},</if>
|
|
|
|
+ <if test="mainname1 != null and mainname1 !=''">#{mainname1},</if>
|
|
|
|
+ #{updateTime},
|
|
|
|
+ <if test="customerType != null and customerType!='' ">#{customerType},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <select id="selectCustomerStart" resultType="java.lang.String">
|
|
|
|
+ select customer_type from customers_start where 1=1
|
|
|
|
+ <if test="customerCode !=null and customerCode !=''">
|
|
|
|
+ and customers_code=#{customerCode}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerType!=null and customerType !=''and type != 3 ">
|
|
|
|
+ and customer_type=#{customerType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerType!=null and customerType !='' and type == 3 ">
|
|
|
|
+ and (customer_type=#{customerType}
|
|
|
|
+ or customer_type=3)
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY customer_type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectCustomerByCustomerCode" resultType="java.lang.String">
|
|
|
|
+ select customer_type from customers_start where 1=1
|
|
|
|
+ <if test="customerCode !=null and customerCode !=''">
|
|
|
|
+ and customers_code=#{customerCode}
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY customer_type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="deleteCustomerStartByCustomerCode" parameterType="String" >
|
|
|
|
+ delete from customers_start where 1=1
|
|
|
|
+ <if test="customerCode !=null and customerCode !=''">
|
|
|
|
+ and customers_code=#{customerCode}
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+ <!-- INSERT INTO customers_start (customers_code, customers_name, online_time,customer_type)
|
|
|
|
|
|
SELECT t.mainkunnr,t.mainname1,t1.online_time,t1.customer_type FROM (
|
|
SELECT t.mainkunnr,t.mainname1,t1.online_time,t1.customer_type FROM (
|
|
|
|
|
|
@@ -144,11 +190,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
GROUP BY kunnr
|
|
GROUP BY kunnr
|
|
) s LEFT JOIN customers_start c ON s.kunnr = c.customers_code
|
|
) s LEFT JOIN customers_start c ON s.kunnr = c.customers_code
|
|
WHERE c.customers_code is null
|
|
WHERE c.customers_code is null
|
|
- ) t LEFT JOIN customers_start t1 ON t.mainkunnr = t1.customers_code
|
|
|
|
-
|
|
|
|
|
|
+ ) t LEFT JOIN customers_start t1 ON t.mainkunnr = t1.customers_code-->
|
|
|
|
|
|
- </insert>
|
|
|
|
|
|
|
|
|
|
+ <select id="selectAssRelCustomer" resultMap="AssRelcustomerinfoResult">
|
|
|
|
+ <include refid="selectAssRelcustomerinfoVo"/>
|
|
|
|
+ where customer_type is not null
|
|
|
|
+ </select>
|
|
<update id="updateAssRelcustomerinfo" parameterType="AssRelcustomerinfo">
|
|
<update id="updateAssRelcustomerinfo" parameterType="AssRelcustomerinfo">
|
|
update ass_relcustomerinfo
|
|
update ass_relcustomerinfo
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
@@ -203,7 +251,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</if> LIMIT 1
|
|
</if> LIMIT 1
|
|
</select>
|
|
</select>
|
|
<select id="selectCustomerNameAndCode" resultMap="AssRelcustomerinfoResult">
|
|
<select id="selectCustomerNameAndCode" resultMap="AssRelcustomerinfoResult">
|
|
- select mainkunnr as mainkunnr,mainname1 as mainname1 FROM `ass_relcustomerinfo`
|
|
|
|
|
|
+ select mainkunnr as mainkunnr,mainmainname1name1 as FROM `ass_relcustomerinfo`
|
|
UNION select kunnr as mainkunnr,name1 as mainname1 FROM `ass_relcustomerinfo`
|
|
UNION select kunnr as mainkunnr,name1 as mainname1 FROM `ass_relcustomerinfo`
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|