You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
4.2 KiB
XML
97 lines
4.2 KiB
XML
4 years ago
|
<?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.glxp.sale.admin.dao.auth.CustomerInfoDao">
|
||
|
|
||
|
<select id="filterCustomerInfo" parameterType="com.glxp.sale.admin.req.auth.CustomerInfoFilterRequest"
|
||
|
resultType="com.glxp.sale.admin.entity.auth.CustomerInfoEntity">
|
||
|
SELECT *
|
||
|
FROM customer_info
|
||
|
<where>
|
||
|
<if test="customerName != null and ''!=customerName">
|
||
|
AND customerName = #{customerName}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="filterDetailCustomerInfo" parameterType="com.glxp.sale.admin.req.auth.CustomerInfoFilterRequest"
|
||
|
resultType="com.glxp.sale.admin.entity.auth.CustomerDetailEntity">
|
||
|
SELECT customer_info.customerId,customer_info.customerName,
|
||
|
customer_info.creditNum,customer_info.area,customer_info.detailAddr,
|
||
|
customer_info.bussinessStatus,customer_info.isInfoLink,customer_info.infoLink,customer_info.roleId,customer_info.userFlag,
|
||
|
customer_contact.contacts,customer_contact.mobile,customer_info.userMax,customer_contact.email,customer_contact.tel,customer_info.companyName
|
||
|
|
||
|
FROM customer_info
|
||
|
INNER JOIN customer_contact on customer_info.customerId=customer_contact.customerId
|
||
|
<where>
|
||
|
<if test="customerName != null and ''!=customerName">
|
||
|
AND customerName = #{customerName}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectDetail" parameterType="java.lang.Long"
|
||
|
resultType="com.glxp.sale.admin.entity.auth.CustomerDetailEntity">
|
||
|
SELECT customer_info.customerId,customer_info.customerName,
|
||
|
customer_info.creditNum,customer_info.area,customer_info.detailAddr,
|
||
|
customer_info.bussinessStatus,customer_info.isInfoLink,customer_info.infoLink,customer_info.roleId,customer_info.userFlag,
|
||
|
customer_contact.contacts,customer_contact.mobile,customer_info.userMax,customer_contact.email,customer_contact.tel,customer_info.companyName
|
||
|
FROM customer_info
|
||
|
INNER JOIN customer_contact on customer_info.customerId=customer_contact.customerId
|
||
|
where customer_info.customerId = #{customerId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertCustomerInfo" keyProperty="customerId"
|
||
|
parameterType="com.glxp.sale.admin.entity.auth.CustomerInfoEntity">
|
||
|
INSERT INTO customer_info
|
||
|
(
|
||
|
customerId, customerName, creditNum,
|
||
|
area, detailAddr, bussinessStatus,
|
||
|
userFlag, isInfoLink, infoLink,
|
||
|
roleId, comments,userMax,companyName
|
||
|
)
|
||
|
values
|
||
|
(
|
||
|
#{customerId},#{customerName},#{creditNum},
|
||
|
#{area},#{detailAddr},#{bussinessStatus},
|
||
|
#{userFlag},#{isInfoLink},#{infoLink},
|
||
|
#{roleId},
|
||
|
#{comments},
|
||
|
#{userMax},#{companyName}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateCustomerInfo" parameterType="com.glxp.sale.admin.entity.auth.CustomerInfoEntity">
|
||
|
UPDATE customer_info
|
||
|
<set>
|
||
|
<if test="customerName != null">customerName=#{customerName},</if>
|
||
|
<if test="creditNum != null">creditNum=#{creditNum},</if>
|
||
|
<if test="area != null">`area`=#{area},</if>
|
||
|
<if test="detailAddr != null">detailAddr=#{detailAddr},</if>
|
||
|
<if test="bussinessStatus != null">`bussinessStatus`=#{bussinessStatus},</if>
|
||
|
<if test="userFlag != null">userFlag=#{userFlag},</if>
|
||
|
<if test="isInfoLink != null">isInfoLink=#{isInfoLink},</if>
|
||
|
<if test="infoLink != null">infoLink=#{infoLink},</if>
|
||
|
<if test="roleId != null">roleId=#{roleId},</if>
|
||
|
<if test="userMax != null">userMax=#{userMax},</if>
|
||
|
<if test="companyName != null">companyName=#{companyName},</if>
|
||
|
</set>
|
||
|
WHERE customerId=#{customerId}
|
||
|
</update>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<delete id="deleteById" parameterType="java.lang.Long">
|
||
|
delete from customer_info where customerId = #{customerId}
|
||
|
</delete>
|
||
|
|
||
|
|
||
|
<select id="selectById" parameterType="java.lang.Long" resultType="com.glxp.sale.admin.entity.auth.CustomerInfoEntity">
|
||
|
SELECT *
|
||
|
FROM customer_info WHERE (
|
||
|
customerId = #{customerId} ) limit 1
|
||
|
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|