| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?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.PersInfoDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.PersInfo" id="persInfoResultMap">
- <result property="dataStat" column="DATA_STAT"/>
- <result property="id" column="ID"/>
- <result property="recPersId" column="REC_PERS_ID"/>
- <result property="recPersName" column="REC_PERS_NAME"/>
- <result property="sndPersId" column="SND_PERS_ID"/>
- <result property="sndPersName" column="SND_PERS_NAME"/>
- <result property="mssgType" column="MSSG_TYPE"/>
- <result property="mssg" column="MSSG"/>
- <result property="mssgClass" column="MSSG_CLASS"/>
- <result property="mssgParam" column="MSSG_PARAM"/>
- <result property="isRead" column="IS_READ"/>
- <result property="isHand" column="IS_HAND"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- </resultMap>
- <sql id="table_columns">
- DATA_STAT,
- ID,
- REC_PERS_ID,
- REC_PERS_NAME,
- SND_PERS_ID,
- SND_PERS_NAME,
- MSSG_TYPE,
- MSSG,
- MSSG_CLASS,
- MSSG_PARAM,
- IS_READ,
- IS_HAND,
- INTM,
- UPTM
- </sql>
- <sql id="entity_properties">
- #{dataStat},
- #{id},
- #{recPersId},
- #{recPersName},
- #{sndPersId},
- #{sndPersName},
- #{mssgType},
- #{mssg},
- #{mssgClass},
- #{mssgParam},
- #{isRead},
- #{isHand},
- #{intm},
- #{uptm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="id != null and id != ''">and ID = #{id}</if>
- <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
- <if test="recPersName != null and recPersName != ''">and REC_PERS_NAME = #{recPersName}</if>
- <if test="sndPersId != null and sndPersId != ''">and SND_PERS_ID = #{sndPersId}</if>
- <if test="sndPersName != null and sndPersName != ''">and SND_PERS_NAME = #{sndPersName}</if>
- <if test="mssgType != null and mssgType != ''">and MSSG_TYPE = #{mssgType}</if>
- <if test="mssg != null and mssg != ''">and MSSG = #{mssg}</if>
- <if test="mssgClass != null and mssgClass != ''">and MSSG_CLASS = #{mssgClass}</if>
- <if test="mssgParam != null and mssgParam != ''">and MSSG_PARAM = #{mssgParam}</if>
- <if test="isRead != null and isRead != ''">and IS_READ = #{isRead}</if>
- <if test="isHand != null and isHand != ''">and IS_HAND = #{isHand}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="persInfoResultMap" parameterType="String" >
- select <include refid="table_columns" /> from GW_SYS_PERS_INFO where ID = #{id}
- </select>
- <select id="getBy" resultMap="persInfoResultMap">
- select <include refid="table_columns" /> from GW_SYS_PERS_INFO <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="persInfoResultMap">
- select <include refid="table_columns" /> from GW_SYS_PERS_INFO
- </select>
- <select id="findList" resultMap="persInfoResultMap">
- select
- <include refid="table_columns" />
- from GW_SYS_PERS_INFO
- <include refid="page_where" />
- ORDER BY INTM DESC
- </select>
- <select id="selectCount" resultType="int" >
- select ifnull(count(ID), 0) from GW_SYS_PERS_INFO <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
- insert into GW_SYS_PERS_INFO( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update GW_SYS_PERS_INFO set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
- update GW_SYS_PERS_INFO set DATA_STAT='9' <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update GW_SYS_PERS_INFO set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
- update GW_SYS_PERS_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="id != null and id != ''">ID = #{id},</if>
- <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
- <if test="recPersName != null and recPersName != ''">REC_PERS_NAME = #{recPersName},</if>
- <if test="sndPersId != null and sndPersId != ''">SND_PERS_ID = #{sndPersId},</if>
- <if test="sndPersName != null and sndPersName != ''">SND_PERS_NAME = #{sndPersName},</if>
- <if test="mssgType != null and mssgType != ''">MSSG_TYPE = #{mssgType},</if>
- <if test="mssg != null and mssg != ''">MSSG = #{mssg},</if>
- <if test="mssgClass != null and mssgClass != ''">MSSG_CLASS = #{mssgClass},</if>
- <if test="mssgParam != null and mssgParam != ''">MSSG_PARAM = #{mssgParam},</if>
- <if test="isRead != null and isRead != ''">IS_READ = #{isRead},</if>
- <if test="isHand != null and isHand != ''">IS_HAND = #{isHand},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
- update GW_SYS_PERS_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="id != null and id != ''">ID = #{id},</if>
- <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
- <if test="recPersName != null and recPersName != ''">REC_PERS_NAME = #{recPersName},</if>
- <if test="sndPersId != null and sndPersId != ''">SND_PERS_ID = #{sndPersId},</if>
- <if test="sndPersName != null and sndPersName != ''">SND_PERS_NAME = #{sndPersName},</if>
- <if test="mssgType != null and mssgType != ''">MSSG_TYPE = #{mssgType},</if>
- <if test="mssg != null and mssg != ''">MSSG = #{mssg},</if>
- <if test="mssgClass != null and mssgClass != ''">MSSG_CLASS = #{mssgClass},</if>
- <if test="mssgParam != null and mssgParam != ''">MSSG_PARAM = #{mssgParam},</if>
- <if test="isRead != null and isRead != ''">IS_READ = #{isRead},</if>
- <if test="isHand != null and isHand != ''">IS_HAND = #{isHand},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|