|
|
|
@ -42,8 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
|
|
|
|
|
<include refid="selectSysCustomerVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode}</if>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
|
|
|
|
<if test="clientCode != null and clientCode != ''"> and client_code like concat('%', #{clientCode}, '%')</if>
|
|
|
|
|
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
|
|
|
|
|
<if test="clientNick != null and clientNick != ''"> and client_nick = #{clientNick}</if>
|
|
|
|
|
<if test="clientEn != null and clientEn != ''"> and client_en = #{clientEn}</if>
|
|
|
|
@ -69,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSysCustomerByClientId" parameterType="Long" resultMap="SysCustomerResult">
|
|
|
|
|
<select id="selectSysCustomerByClientId" parameterType="java.lang.String" resultMap="SysCustomerResult">
|
|
|
|
|
<include refid="selectSysCustomerVo"/>
|
|
|
|
|
where client_id = #{clientId}
|
|
|
|
|
</select>
|
|
|
|
@ -77,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="clientId">
|
|
|
|
|
insert into sys_customer
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="clientId != null and clientId != ''">client_id,</if>
|
|
|
|
|
<if test="clientCode != null and clientCode != ''">client_code,</if>
|
|
|
|
|
<if test="clientName != null and clientName != ''">client_name,</if>
|
|
|
|
|
<if test="clientNick != null">client_nick,</if>
|
|
|
|
@ -107,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
|
|
|
|
<if test="clientCode != null and clientCode != ''">#{clientCode},</if>
|
|
|
|
|
<if test="clientName != null and clientName != ''">#{clientName},</if>
|
|
|
|
|
<if test="clientNick != null">#{clientNick},</if>
|
|
|
|
@ -173,7 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
where client_id = #{clientId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSysCustomerByClientId" parameterType="Long">
|
|
|
|
|
<delete id="deleteSysCustomerByClientId" parameterType="java.lang.String">
|
|
|
|
|
delete from sys_customer where client_id = #{clientId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
@ -183,4 +186,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
#{clientId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="checkClientCodeUnique" parameterType="SysCustomer" resultType ="java.lang.String">
|
|
|
|
|
select client_code
|
|
|
|
|
from sys_customer
|
|
|
|
|
where client_code = #{clientCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="checkClientNameUnique" parameterType="SysCustomer" resultType ="java.lang.String">
|
|
|
|
|
select client_code
|
|
|
|
|
from sys_customer
|
|
|
|
|
where client_name = #{clientName}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|