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.
udi-wms-java/src/main/resources/mybatis/mapper/purchase/CustomerContactDao.xml

62 lines
2.1 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.glxp.api.dao.purchase.CustomerContacDao">
<select id="filterCustomerContact" parameterType="com.glxp.api.req.purchase.CustomerContactFilterRequest"
resultType="com.glxp.api.entity.purchase.CustomerContactEntity">
SELECT *
FROM customer_contact
<where>
<if test="customerId != null and ''!=customerId">
AND customerId = #{customerId}
</if>
</where>
</select>
<insert id="insertCustomerContact" keyProperty="customerId"
parameterType="com.glxp.api.entity.purchase.CustomerContactEntity">
INSERT INTO customer_contact
(customerId, contacts,
mobile, tel, email,
comments)
values (#{customerId}, #{contacts},
#{mobile}, #{tel}, #{email},
#{comments})
</insert>
<update id="updateCustomerContact" parameterType="com.glxp.api.entity.purchase.CustomerContactEntity">
UPDATE customer_contact
<set>
<if test="contacts != null">contacts=#{contacts},</if>
<if test="mobile != null">mobile=#{mobile},</if>
<if test="tel != null">tel=#{tel},</if>
<if test="email != null">email=#{email},</if>
<if test="comments != null">comments=#{comments},</if>
</set>
WHERE customerId=#{customerId}
</update>
<delete id="deleteById" parameterType="java.lang.String">
delete
from customer_contact
where customerId = #{customerId}
</delete>
<delete id="deleteContact" parameterType="com.glxp.api.req.system.DeleteRequest">
delete
from customer_contact
where customerId = #{customerId}
</delete>
<select id="selectById" parameterType="java.lang.Long"
resultType="com.glxp.api.entity.purchase.CustomerContactEntity">
SELECT *
FROM customer_contact
WHERE (
customerId = #{customerId}) limit 1
</select>
</mapper>