xkrs_ms/stdiet-custom/src/main/resources/mapper/custom/SysWxSubscribePostLogMapper.xml
2021-05-18 14:02:56 +08:00

56 lines
2.7 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.stdiet.custom.mapper.SysWxSubscribePostLogMapper">
<resultMap type="WxSubscribePostLog" id="WxSubscribePostLogResult">
<result property="id" column="id"/>
<result property="appid" column="appid"/>
<result property="openid" column="openid"/>
<result property="sendTime" column="send_time"/>
<result property="planId" column="plan_id"/>
<result property="phone" column="phone"/>
<result property="result" column="result" typeHandler="com.stdiet.custom.typehandler.ObjectJsonHandler"/>
<result property="data" column="data" typeHandler="com.stdiet.custom.typehandler.ObjectJsonHandler"/>
</resultMap>
<insert id="insertWxSubscribePostLog" parameterType="WxSubscribePostLog" useGeneratedKeys="true" keyProperty="id">
insert into sys_wx_subscribe_post_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="appid != null">appid,</if>
<if test="openid != null">openid,</if>
<if test="planId != null">plan_id,</if>
<if test="sendTime != null">send_time,</if>
<if test="result != null">result,</if>
<if test="phone != null">phone,</if>
<if test="data != null">data,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="appid != null">#{appid},</if>
<if test="openid != null">#{openid},</if>
<if test="planId != null">#{planId},</if>
<if test="sendTime != null">#{sendTime},</if>
<if test="result != null">#{result, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ObjectJsonHandler},</if>
<if test="phone != null">#{phone},</if>
<if test="data != null">#{data, jdbcType=OTHER, typeHandler=com.stdiet.custom.typehandler.ObjectJsonHandler},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<select id="selectWxSubscribePostLog" parameterType="WxSubscribePostLog" resultMap="WxSubscribePostLogResult">
select * from sys_wx_subscribe_post_log
<where>
<if test="id != null">AND id = #{id}</if>
<if test="openid != null">AND openid = #{openid}</if>
<if test="appid != null">AND appid = #{appid}</if>
<if test="planId != null">AND plan_id = #{planId}</if>
<if test="phone != null">AND phone = #{phone}</if>
<if test="type != null">AND type = #{type}</if>
</where>
</select>
</mapper>