|
@@ -0,0 +1,133 @@
|
|
|
+<?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.dgtly.system.mapper.AssRelcustomerinfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="AssRelcustomerinfo" id="AssRelcustomerinfoResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="isDelete" column="is_delete" />
|
|
|
+ <result property="mainkunnr" column="mainkunnr" />
|
|
|
+ <result property="mainname1" column="mainname1" />
|
|
|
+ <result property="kunnr" column="kunnr" />
|
|
|
+ <result property="name1" column="name1" />
|
|
|
+ <result property="glfs" column="glfs" />
|
|
|
+ <result property="glsj" column="glsj" />
|
|
|
+ <result property="enddate" column="enddate" />
|
|
|
+ <result property="etlCreatetime" column="ETL_createtime" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectAssRelcustomerinfoVo">
|
|
|
+ select id, create_by, create_time, update_by, update_time, is_delete, mainkunnr, mainname1, kunnr, name1, glfs, glsj, enddate, ETL_createtime from ass_relcustomerinfo
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectAssRelcustomerinfoList" parameterType="AssRelcustomerinfo" resultMap="AssRelcustomerinfoResult">
|
|
|
+ <include refid="selectAssRelcustomerinfoVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ <if test="mainkunnr != null and mainkunnr != ''"> and mainkunnr = #{mainkunnr}</if>
|
|
|
+ <if test="mainname1 != null and mainname1 != ''"> and mainname1 = #{mainname1}</if>
|
|
|
+ <if test="kunnr != null and kunnr != ''"> and kunnr = #{kunnr}</if>
|
|
|
+ <if test="name1 != null and name1 != ''"> and name1 = #{name1}</if>
|
|
|
+ <if test="glfs != null and glfs != ''"> and glfs = #{glfs}</if>
|
|
|
+ <if test="glsj != null "> and glsj = #{glsj}</if>
|
|
|
+ <if test="enddate != null "> and enddate = #{enddate}</if>
|
|
|
+ <if test="etlCreatetime != null "> and ETL_createtime = #{etlCreatetime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectAssRelcustomerinfoById" parameterType="Long" resultMap="AssRelcustomerinfoResult">
|
|
|
+ <include refid="selectAssRelcustomerinfoVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectRelcustomerinfoListByorgCode" resultMap="AssRelcustomerinfoResult">
|
|
|
+ <include refid="selectAssRelcustomerinfoVo"/>
|
|
|
+ where
|
|
|
+ glfs != '开票方关联'
|
|
|
+ AND (
|
|
|
+ SELECT
|
|
|
+ ar.mainkunnr
|
|
|
+ FROM
|
|
|
+ ass_relcustomerinfo ar
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND (
|
|
|
+ #{orgCode} = ar.mainkunnr
|
|
|
+ OR #{orgCode} = ar.kunnr
|
|
|
+ )
|
|
|
+ GROUP BY
|
|
|
+ ar.mainkunnr
|
|
|
+ ) = mainkunnr
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertAssRelcustomerinfo" parameterType="AssRelcustomerinfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into ass_relcustomerinfo
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <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>
|
|
|
+ <if test="isDelete != null ">is_delete,</if>
|
|
|
+ <if test="mainkunnr != null and mainkunnr != ''">mainkunnr,</if>
|
|
|
+ <if test="mainname1 != null and mainname1 != ''">mainname1,</if>
|
|
|
+ <if test="kunnr != null and kunnr != ''">kunnr,</if>
|
|
|
+ <if test="name1 != null and name1 != ''">name1,</if>
|
|
|
+ <if test="glfs != null and glfs != ''">glfs,</if>
|
|
|
+ <if test="glsj != null ">glsj,</if>
|
|
|
+ <if test="enddate != null ">enddate,</if>
|
|
|
+ <if test="etlCreatetime != null ">ETL_createtime,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <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>
|
|
|
+ <if test="isDelete != null ">#{isDelete},</if>
|
|
|
+ <if test="mainkunnr != null and mainkunnr != ''">#{mainkunnr},</if>
|
|
|
+ <if test="mainname1 != null and mainname1 != ''">#{mainname1},</if>
|
|
|
+ <if test="kunnr != null and kunnr != ''">#{kunnr},</if>
|
|
|
+ <if test="name1 != null and name1 != ''">#{name1},</if>
|
|
|
+ <if test="glfs != null and glfs != ''">#{glfs},</if>
|
|
|
+ <if test="glsj != null ">#{glsj},</if>
|
|
|
+ <if test="enddate != null ">#{enddate},</if>
|
|
|
+ <if test="etlCreatetime != null ">#{etlCreatetime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateAssRelcustomerinfo" parameterType="AssRelcustomerinfo">
|
|
|
+ update ass_relcustomerinfo
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <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>
|
|
|
+ <if test="isDelete != null ">is_delete = #{isDelete},</if>
|
|
|
+ <if test="mainkunnr != null and mainkunnr != ''">mainkunnr = #{mainkunnr},</if>
|
|
|
+ <if test="mainname1 != null and mainname1 != ''">mainname1 = #{mainname1},</if>
|
|
|
+ <if test="kunnr != null and kunnr != ''">kunnr = #{kunnr},</if>
|
|
|
+ <if test="name1 != null and name1 != ''">name1 = #{name1},</if>
|
|
|
+ <if test="glfs != null and glfs != ''">glfs = #{glfs},</if>
|
|
|
+ <if test="glsj != null ">glsj = #{glsj},</if>
|
|
|
+ <if test="enddate != null ">enddate = #{enddate},</if>
|
|
|
+ <if test="etlCreatetime != null ">ETL_createtime = #{etlCreatetime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteAssRelcustomerinfoById" parameterType="Long">
|
|
|
+ delete from ass_relcustomerinfo where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteAssRelcustomerinfoByIds" parameterType="String">
|
|
|
+ delete from ass_relcustomerinfo where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|