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