|
|
|
@ -34,10 +34,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectSysCustomerVo">
|
|
|
|
|
select client_id, client_code, client_name, client_nick, client_en, client_des, client_logo, client_type, address, website, email, tel, contact1, contact1_tel, contact1_email, contact2, contact2_tel, contact2_email, credit_code, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from sys_customer
|
|
|
|
|
select client_id, client_code, client_name, client_nick, client_en, client_des, client_logo, client_type, address, website, email, tel, contact1, contact1_tel, contact1_email, contact2, contact2_tel, contact2_email, credit_code, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time ,del_flag from sys_customer
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
|
|
|
@ -67,12 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
|
|
|
<if test="attr3 != null "> and attr3 = #{attr3}</if>
|
|
|
|
|
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSysCustomerByClientId" parameterType="java.lang.String" resultMap="SysCustomerResult">
|
|
|
|
|
<include refid="selectSysCustomerVo"/>
|
|
|
|
|
where client_id = #{clientId}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="clientId">
|
|
|
|
@ -176,27 +179,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
where client_id = #{clientId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSysCustomerByClientId" parameterType="java.lang.String">
|
|
|
|
|
delete from sys_customer where client_id = #{clientId}
|
|
|
|
|
</delete>
|
|
|
|
|
<update id="deleteSysCustomerByClientId" parameterType="java.lang.String">
|
|
|
|
|
update sys_customer
|
|
|
|
|
set del_flag = '1'
|
|
|
|
|
where client_id = #{clientId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSysCustomerByClientIds" parameterType="String">
|
|
|
|
|
delete from sys_customer where client_id in
|
|
|
|
|
<update id="deleteSysCustomerByClientIds" parameterType="String">
|
|
|
|
|
update sys_customer
|
|
|
|
|
set del_flag = '1'
|
|
|
|
|
where client_id in
|
|
|
|
|
<foreach item="clientId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{clientId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<select id="checkClientCodeUnique" parameterType="SysCustomer" resultType ="java.lang.String">
|
|
|
|
|
select client_code
|
|
|
|
|
from sys_customer
|
|
|
|
|
where client_code = #{clientCode}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="checkClientNameUnique" parameterType="SysCustomer" resultType ="java.lang.String">
|
|
|
|
|
select client_code
|
|
|
|
|
from sys_customer
|
|
|
|
|
where client_name = #{clientName}
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|