113 lines
5.6 KiB
XML
113 lines
5.6 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.EmisCustomerSignMapper">
|
||
|
|
|
||
|
|
<resultMap type="EmisCustomerSign" id="EmisCustomerSignResult"
|
||
|
|
extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
||
|
|
<result property="id" column="id"/>
|
||
|
|
<result property="appId" column="app_id"/>
|
||
|
|
<result property="appKey" column="app_key"/>
|
||
|
|
<result property="securityKey" column="security_key"/>
|
||
|
|
<result property="custNo" column="cust_no"/>
|
||
|
|
<result property="custName" column="cust_name"/>
|
||
|
|
<result property="ownerSite" column="owner_site"/>
|
||
|
|
<result property="status" column="status"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectEmisCustomerSignVo">
|
||
|
|
select id, app_id, app_key, security_key, cust_no, cust_name, owner_site, status, remark, create_by, create_time, update_by, update_time, create_site, update_site, del_flag
|
||
|
|
from emis_customer_sign
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectEmisCustomerSignList" parameterType="EmisCustomerSign" resultMap="EmisCustomerSignResult">
|
||
|
|
<include refid="selectEmisCustomerSignVo"/>
|
||
|
|
<where>
|
||
|
|
del_flag = '0'
|
||
|
|
<if test="appId != null and appId != ''"> and app_id = #{appId}</if>
|
||
|
|
<if test="custNo != null and custNo != ''"> and cust_no = #{custNo}</if>
|
||
|
|
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||
|
|
<if test="status == null"> and (status = '0' or status is null)</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectEmisCustomerSignByAppId" parameterType="String" resultMap="EmisCustomerSignResult">
|
||
|
|
<include refid="selectEmisCustomerSignVo"/>
|
||
|
|
where del_flag = '0'
|
||
|
|
and app_id = #{appId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectEmisCustomerSignById" parameterType="Long" resultMap="EmisCustomerSignResult">
|
||
|
|
<include refid="selectEmisCustomerSignVo"/>
|
||
|
|
where del_flag = '0'
|
||
|
|
and id = #{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertEmisCustomerSign" parameterType="EmisCustomerSign" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into emis_customer_sign
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="appId != null">app_id,</if>
|
||
|
|
<if test="appKey != null">app_key,</if>
|
||
|
|
<if test="securityKey != null">security_key,</if>
|
||
|
|
<if test="custNo != null">cust_no,</if>
|
||
|
|
<if test="custName != null">cust_name,</if>
|
||
|
|
<if test="ownerSite != null and ownerSite != ''">owner_site,</if>
|
||
|
|
<if test="status != null">status,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
<if test="createBy != null">create_by,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateBy != null">update_by,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
||
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="appId != null">#{appId},</if>
|
||
|
|
<if test="appKey != null">#{appKey},</if>
|
||
|
|
<if test="securityKey != null">#{securityKey},</if>
|
||
|
|
<if test="custNo != null">#{custNo},</if>
|
||
|
|
<if test="custName != null">#{custName},</if>
|
||
|
|
<if test="ownerSite != null and ownerSite != ''">#{ownerSite},</if>
|
||
|
|
<if test="status != null">#{status},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
<if test="createBy != null">#{createBy},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateBy != null">#{updateBy},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
||
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateEmisCustomerSign" parameterType="EmisCustomerSign">
|
||
|
|
update emis_customer_sign
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="appId != null">app_id = #{appId},</if>
|
||
|
|
<if test="appKey != null">app_key = #{appKey},</if>
|
||
|
|
<if test="securityKey != null">security_key = #{securityKey},</if>
|
||
|
|
<if test="custNo != null">cust_no = #{custNo},</if>
|
||
|
|
<if test="custName != null">cust_name = #{custName},</if>
|
||
|
|
<if test="ownerSite != null and ownerSite != ''">owner_site=#{ownerSite},</if>
|
||
|
|
<if test="status != null">status = #{status},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
<if test="updateSite != null and updateSite != ''">update_site=#{updateSite},</if>
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteEmisCustomerSignById" parameterType="Long">
|
||
|
|
update emis_customer_sign set del_flag = '1' where id = #{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteEmisCustomerSignByIds" parameterType="String">
|
||
|
|
update emis_customer_sign set del_flag = '1'
|
||
|
|
where id in
|
||
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
|
#{id}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|