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.

63 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.udi.admin.dao.auth.CustomerContacDao">
<select id="filterCustomerContact" parameterType="com.glxp.udi.admin.req.auth.CustomerContactFilterRequest"
resultType="com.glxp.udi.admin.entity.auth.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.udi.admin.entity.auth.CustomerInfoEntity">
INSERT INTO customer_contact
(
customerId, contacts,
mobile, tel, email,
comments
)
values
(
#{customerId},#{contacts},
#{mobile},#{tel},#{email},
#{comments}
)
</insert>
<update id="updateCustomerContact" parameterType="com.glxp.udi.admin.entity.auth.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.Long">
delete from customer_contact where customerId = #{customerId}
</delete>
<delete id="deleteContact" parameterType="com.glxp.udi.admin.req.inout.DeleteRequest">
delete from customer_contact where customerId = #{customerId}
</delete>
<select id="selectById" parameterType="java.lang.Long"
resultType="com.glxp.udi.admin.entity.auth.CustomerContactEntity">
SELECT *
FROM customer_contact WHERE (
customerId = #{customerId} ) limit 1
</select>
</mapper>