123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.yijia.customer.mapper.CardExcelImportMapper">
- <resultMap type="CardExcelImport" id="CardExcelImportResult">
- <result property="excelId" column="excel_id" />
- <result property="balance" column="balance" />
- <result property="integral" column="integral" />
- <result property="phoneNumber" column="phone_number" />
- <result property="cardType" column="card_type" />
- <result property="stationId" column="station_id" />
- <result property="memberGrade" column="member_grade" />
- <result property="stationName" column="dept_name" />
- <result property="labelId" column="label_id" />
- <result property="couponIssueId" column="coupon_issue_id" />
- </resultMap>
- <sql id="selectCardExcelImportVo">
- SELECT a.excel_id,a.station_id,a.phone_number,
- a.member_grade,a.integral,a.card_type,a.balance,b.dept_name,
- a.label_id,a.coupon_issue_id
- from card_excel_import a
- left join sys_dept b on a.station_id=b.dept_id
- </sql>
- <select id="selectCardExcelImportList" parameterType="CardExcelImport" resultMap="CardExcelImportResult">
- <include refid="selectCardExcelImportVo"/>
- <where>
- <if test="balance != null and balance != ''"> and a.balance = #{balance}</if>
- <if test="integral != null and integral != ''"> and a.integral = #{integral}</if>
- <if test="phoneNumber != null and phoneNumber != ''"> and a.phone_number = #{phoneNumber}</if>
- <if test="cardType != null and cardType != ''"> and a.card_type = #{cardType} </if>
- <if test="stationId != null and stationId != ''"> and a.station_id = #{stationId}</if>
- <if test="memberGrade != null and memberGrade != ''"> and a.member_grade = #{memberGrade}</if>
- <if test="labelId != null and labelId != ''"> and a.label_id = #{labelId}</if>
- <if test="couponIssueId != null and couponIssueId != ''"> and a.coupon_issue_id = #{couponIssueId}</if>
- <if test="stationIdList != null ">
- and a.station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by excel_id desc
- </select>
- <select id="selectCardExcelImportById" parameterType="Long" resultMap="CardExcelImportResult">
- <include refid="selectCardExcelImportVo"/>
- where excel_id = #{excelId}
- </select>
- <select id="selectCardExcelImportByPhoneStation" parameterType="CardExcelImport" resultMap="CardExcelImportResult">
- <include refid="selectCardExcelImportVo"/>
- <where>
- <if test="phoneNumber != null and phoneNumber != ''"> and a.phone_number = #{phoneNumber}</if>
- <if test="stationId != null and stationId != ''"> and a.station_id = #{stationId}</if>
- </where>
- </select>
- <insert id="insertCardExcelImport" parameterType="CardExcelImport" useGeneratedKeys="true" keyProperty="excelId">
- insert into card_excel_import
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="balance != null">balance,</if>
- <if test="integral != null">integral,</if>
- <if test="phoneNumber != null">phone_number,</if>
- <if test="cardType != null">card_type,</if>
- <if test="stationId != null">station_id,</if>
- <if test="memberGrade != null">member_grade,</if>
- <if test="labelId != null">label_id,</if>
- <if test="couponIssueId != null">coupon_issue_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="balance != null">#{balance},</if>
- <if test="integral != null">#{integral},</if>
- <if test="phoneNumber != null">#{phoneNumber},</if>
- <if test="cardType != null">#{cardType},</if>
- <if test="stationId != null">#{stationId},</if>
- <if test="memberGrade != null">#{memberGrade},</if>
- <if test="labelId != null">#{labelId},</if>
- <if test="couponIssueId != null">#{couponIssueId},</if>
- </trim>
- </insert>
- <update id="updateCardExcelImport" parameterType="CardExcelImport">
- update card_excel_import
- <trim prefix="SET" suffixOverrides=",">
- <if test="balance != null">balance = #{balance},</if>
- <if test="integral != null">integral = #{integral},</if>
- <if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
- <if test="cardType != null">card_type = #{cardType},</if>
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="memberGrade != null">member_grade = #{memberGrade},</if>
- <if test="labelId != null">label_id = #{labelId},</if>
- <if test="couponIssueId != null">coupon_issue_id = #{couponIssueId},</if>
- </trim>
- where excel_id = #{excelId}
- </update>
- <delete id="deleteCardExcelImportById" parameterType="Long">
- delete from card_excel_import where excel_id = #{excelId}
- </delete>
- <delete id="deleteCardExcelImportByIds" parameterType="String">
- delete from card_excel_import where excel_id in
- <foreach item="excelId" collection="array" open="(" separator="," close=")">
- #{excelId}
- </foreach>
- </delete>
- </mapper>
|