123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <?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.kmall.admin.fromcomm.dao.SysSmsLogDao">
- <resultMap type="com.kmall.manager.entity.SysSmsLogEntity" id="smsLogMap">
- <result property="id" column="id"/>
- <result property="userId" column="user_id"/>
- <result property="content" column="content"/>
- <result property="mobile" column="mobile"/>
- <result property="storeId" column="store_id"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="stime" column="stime"/>
- <result property="sign" column="sign"/>
- <result property="type" column="type"/>
- <result property="extno" column="extno"/>
- <result property="sendStatus" column="send_status"/>
- <result property="sendId" column="send_id"/>
- <result property="invalidNum" column="invalid_num"/>
- <result property="successNum" column="success_num"/>
- <result property="blackNum" column="black_num"/>
- <result property="returnMsg" column="return_msg"/>
- <result property="smsode" column="sms_code"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.manager.entity.SysSmsLogEntity">
- select
- `id`,
- `user_id`,
- `content`,
- `mobile`,
- `store_id`,
- `merch_sn`,
- `stime`,
- `sign`,
- `type`,
- `extno`,
- `send_status`,
- `send_id`,
- `invalid_num`,
- `success_num`,
- `black_num`,
- `return_msg`,
- sms_code
- from sys_sms_log
- where id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.manager.entity.SysSmsLogEntity">
- select
- sys_sms_log.id,
- sys_sms_log.user_id,
- sys_sms_log.content,
- sys_sms_log.mobile,
- sys_sms_log.store_id,
- sys_sms_log.merch_sn,
- sys_sms_log.stime,
- sys_sms_log.sign,
- sys_sms_log.type,
- sys_sms_log.extno,
- sys_sms_log.send_status,
- sys_sms_log.send_id,
- sys_sms_log.invalid_num,
- sys_sms_log.success_num,
- sys_sms_log.black_num,
- sys_sms_log.return_msg,
- sys_sms_log.sms_code,
- mall_user.nickname user_name
- from sys_sms_log
- LEFT JOIN mall_user ON mall_user.id = sys_sms_log.user_id
- left join mall_store s on sys_sms_log.store_id = s.id
- WHERE 1=1
- <if test="storeId != null and storeId != ''">
- AND sys_sms_log.store_id = #{storeId}
- </if>
- <if test="merchSn != null and merchSn.trim() != ''">
- AND sys_sms_log.merch_sn = #{merchSn}
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- <if test="sendId != null and sendId != ''">
- AND sys_sms_log.send_id LIKE concat('%',#{sendId},'%')
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by stime DESC
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from sys_sms_log
- left join mall_store s on sys_sms_log.store_id = s.id
- WHERE 1=1
- <if test="storeId != null and storeId != ''">
- AND sys_sms_log.store_id = #{storeId}
- </if>
- <if test="merchSn != null and merchSn.trim() != ''">
- AND sys_sms_log.merch_sn = #{merchSn}
- </if>
- <if test="sendId != null and sendId != ''">
- AND send_id LIKE concat('%',#{sendId},'%')
- </if>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
- AND s.third_party_merch_code = #{thirdPartyMerchCode}
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.manager.entity.SysSmsLogEntity">
- insert into sys_sms_log(
- `user_id`,
- `content`,
- `mobile`,
- `store_id`,
- `merch_sn`,
- `stime`,
- `sign`,
- `type`,
- `extno`,
- `send_status`,
- `send_id`,
- `invalid_num`,
- `success_num`,
- `black_num`,
- sms_code,
- `return_msg`)
- values(
- #{userId},
- #{content},
- #{mobile},
- #{storeId},
- #{merchSn},
- #{stime},
- #{sign},
- #{type},
- #{extno},
- #{sendStatus},
- #{sendId},
- #{invalidNum},
- #{successNum},
- #{blackNum},
- #{smsCode},
- #{returnMsg})
- </insert>
- <update id="update" parameterType="com.kmall.manager.entity.SysSmsLogEntity">
- update sys_sms_log
- <set>
- <if test="userId != null">`user_id` = #{userId},</if>
- <if test="content != null">`content` = #{content},</if>
- <if test="mobile != null">`mobile` = #{mobile},</if>
- <if test="storeId != null">`store_id` = #{storeId}, </if>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="stime != null">`stime` = #{stime},</if>
- <if test="sign != null">`sign` = #{sign},</if>
- <if test="type != null">`type` = #{type},</if>
- <if test="extno != null">`extno` = #{extno},</if>
- <if test="sendStatus != null">`send_status` = #{sendStatus},</if>
- <if test="sendId != null">`send_id` = #{sendId},</if>
- <if test="invalidNum != null">`invalid_num` = #{invalidNum},</if>
- <if test="successNum != null">`success_num` = #{successNum},</if>
- <if test="blackNum != null">`black_num` = #{blackNum},</if>
- <if test="smsCode != null">`sms_code` = #{smsCode},</if>
- <if test="returnMsg != null">`return_msg` = #{returnMsg}</if>
- </set>
- where id = #{id}
- </update>
- <delete id="delete">
- delete from sys_sms_log where id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from sys_sms_log where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="querySmsCodeByUserId" resultType="com.kmall.manager.entity.SysSmsLogEntity">
- select
- a.id,
- a.user_id,
- a.content,
- a.mobile,
- a.store_id,
- a.merch_sn,
- a.stime,
- a.sign,
- a.type,
- a.extno,
- a.send_status,
- a.send_id,
- a.invalid_num,
- a.success_num,
- a.black_num,
- a.return_msg,
- a.sms_code
- from sys_sms_log a
- left join sys_sms_log b on a.user_id = b.user_id and b.stime > a.stime
- where a.user_id = #{user_id} and b.id is null
- </select>
- </mapper>
|