| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <?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="cn.com.goldenwater.dcproj.dao.ExtWeiXinMessageDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage" id="extWeiXinMessageResultMap">
- <result property="id" column="ID"/>
- <result property="wcId" column="WC_ID"/>
- <result property="account" column="ACCOUNT"/>
- <result property="messageType" column="MESSAGE_TYPE"/>
- <result property="fromUser" column="FROM_USER"/>
- <result property="fromGroup" column="FROM_GROUP"/>
- <result property="toUser" column="TO_USER"/>
- <result property="msgId" column="MSG_ID"/>
- <result property="newMsgId" column="NEW_MSG_ID"/>
- <result property="tm" column="TM"/>
- <result property="content" column="CONTENT"/>
- <result property="self" column="SELF"/>
- <result property="isDeal" column="IS_DEAL"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="dataStat" column="DATA_STAT"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- WC_ID,
- ACCOUNT,
- MESSAGE_TYPE,
- FROM_USER,
- FROM_GROUP,
- TO_USER,
- MSG_ID,
- NEW_MSG_ID,
- TM,
- CONTENT,
- SELF,
- IS_DEAL,
- INTM,
- UPTM,
- DATA_STAT
- </sql>
- <sql id="entity_properties">
- #{id},
- #{wcId},
- #{account},
- #{messageType},
- #{fromUser},
- #{fromGroup},
- #{toUser},
- #{msgId},
- #{newMsgId},
- #{tm},
- #{content},
- #{self},
- #{isDeal},
- #{intm},
- #{uptm},
- #{dataStat}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="wcId != null and wcId != ''">and WC_ID = #{wcId}</if>
- <if test="account != null and account != ''">and ACCOUNT = #{account}</if>
- <if test="messageType != null and messageType != ''">and MESSAGE_TYPE = #{messageType}</if>
- <if test="fromUser != null and fromUser != ''">and FROM_USER = #{fromUser}</if>
- <if test="fromGroup != null and fromGroup != ''">and FROM_GROUP = #{fromGroup}</if>
- <if test="toUser != null and toUser != ''">and TO_USER = #{toUser}</if>
- <if test="msgId != null and msgId != ''">and MSG_ID = #{msgId}</if>
- <if test="newMsgId != null and newMsgId != ''">and NEW_MSG_ID = #{newMsgId}</if>
- <if test="tm != null">and TM = #{tm}</if>
- <if test="content != null and content != ''">and CONTENT = #{content}</if>
- <if test="self != null and self != ''">and SELF = #{self}</if>
- <if test="isDeal != null and isDeal != ''">and IS_DEAL = #{isDeal}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- </trim>
- </sql>
- <select id="get" resultMap="extWeiXinMessageResultMap" parameterType="String" >
- select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE where ID = #{id}
- </select>
- <select id="getBy" resultMap="extWeiXinMessageResultMap">
- select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="extWeiXinMessageResultMap">
- select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE
- </select>
- <select id="findList" resultMap="extWeiXinMessageResultMap">
- select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
- insert into EXT_WEI_XIN_MESSAGE( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update EXT_WEI_XIN_MESSAGE set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
- delete from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update EXT_WEI_XIN_MESSAGE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
- update EXT_WEI_XIN_MESSAGE
- <trim prefix="set" suffixOverrides=",">
- <if test="wcId != null and wcId != ''">WC_ID = #{wcId},</if>
- <if test="account != null and account != ''">ACCOUNT = #{account},</if>
- <if test="messageType != null and messageType != ''">MESSAGE_TYPE = #{messageType},</if>
- <if test="fromUser != null and fromUser != ''">FROM_USER = #{fromUser},</if>
- <if test="fromGroup != null and fromGroup != ''">FROM_GROUP = #{fromGroup},</if>
- <if test="toUser != null and toUser != ''">TO_USER = #{toUser},</if>
- <if test="msgId != null and msgId != ''">MSG_ID = #{msgId},</if>
- <if test="newMsgId != null and newMsgId != ''">NEW_MSG_ID = #{newMsgId},</if>
- <if test="tm != null">TM = #{tm},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="self != null and self != ''">SELF = #{self},</if>
- <if test="isDeal != null and isDeal != ''">IS_DEAL = #{isDeal},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
- update EXT_WEI_XIN_MESSAGE
- <trim prefix="set" suffixOverrides=",">
- <if test="wcId != null and wcId != ''">WC_ID = #{wcId},</if>
- <if test="account != null and account != ''">ACCOUNT = #{account},</if>
- <if test="messageType != null and messageType != ''">MESSAGE_TYPE = #{messageType},</if>
- <if test="fromUser != null and fromUser != ''">FROM_USER = #{fromUser},</if>
- <if test="fromGroup != null and fromGroup != ''">FROM_GROUP = #{fromGroup},</if>
- <if test="toUser != null and toUser != ''">TO_USER = #{toUser},</if>
- <if test="msgId != null and msgId != ''">MSG_ID = #{msgId},</if>
- <if test="newMsgId != null and newMsgId != ''">NEW_MSG_ID = #{newMsgId},</if>
- <if test="tm != null">TM = #{tm},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="self != null and self != ''">SELF = #{self},</if>
- <if test="isDeal != null and isDeal != ''">IS_DEAL = #{isDeal},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|