PersInfoDao.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.PersInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.PersInfo" id="persInfoResultMap">
  5. <result property="dataStat" column="DATA_STAT"/>
  6. <result property="id" column="ID"/>
  7. <result property="recPersId" column="REC_PERS_ID"/>
  8. <result property="recPersName" column="REC_PERS_NAME"/>
  9. <result property="sndPersId" column="SND_PERS_ID"/>
  10. <result property="sndPersName" column="SND_PERS_NAME"/>
  11. <result property="mssgType" column="MSSG_TYPE"/>
  12. <result property="mssg" column="MSSG"/>
  13. <result property="mssgClass" column="MSSG_CLASS"/>
  14. <result property="mssgParam" column="MSSG_PARAM"/>
  15. <result property="isRead" column="IS_READ"/>
  16. <result property="isHand" column="IS_HAND"/>
  17. <result property="intm" column="INTM"/>
  18. <result property="uptm" column="UPTM"/>
  19. </resultMap>
  20. <sql id="table_columns">
  21. DATA_STAT,
  22. ID,
  23. REC_PERS_ID,
  24. REC_PERS_NAME,
  25. SND_PERS_ID,
  26. SND_PERS_NAME,
  27. MSSG_TYPE,
  28. MSSG,
  29. MSSG_CLASS,
  30. MSSG_PARAM,
  31. IS_READ,
  32. IS_HAND,
  33. INTM,
  34. UPTM
  35. </sql>
  36. <sql id="entity_properties">
  37. #{dataStat},
  38. #{id},
  39. #{recPersId},
  40. #{recPersName},
  41. #{sndPersId},
  42. #{sndPersName},
  43. #{mssgType},
  44. #{mssg},
  45. #{mssgClass},
  46. #{mssgParam},
  47. #{isRead},
  48. #{isHand},
  49. #{intm},
  50. #{uptm}
  51. </sql>
  52. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  53. <sql id="page_where">
  54. <trim prefix="where" prefixOverrides="and | or ">
  55. <if test="id != null and id != ''">and ID = #{id}</if>
  56. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  57. <if test="recPersName != null and recPersName != ''">and REC_PERS_NAME = #{recPersName}</if>
  58. <if test="sndPersId != null and sndPersId != ''">and SND_PERS_ID = #{sndPersId}</if>
  59. <if test="sndPersName != null and sndPersName != ''">and SND_PERS_NAME = #{sndPersName}</if>
  60. <if test="mssgType != null and mssgType != ''">and MSSG_TYPE = #{mssgType}</if>
  61. <if test="mssg != null and mssg != ''">and MSSG = #{mssg}</if>
  62. <if test="mssgClass != null and mssgClass != ''">and MSSG_CLASS = #{mssgClass}</if>
  63. <if test="mssgParam != null and mssgParam != ''">and MSSG_PARAM = #{mssgParam}</if>
  64. <if test="isRead != null and isRead != ''">and IS_READ = #{isRead}</if>
  65. <if test="isHand != null and isHand != ''">and IS_HAND = #{isHand}</if>
  66. <if test="intm != null">and INTM = #{intm}</if>
  67. <if test="uptm != null">and UPTM = #{uptm}</if>
  68. and DATA_STAT='0'
  69. </trim>
  70. </sql>
  71. <select id="get" resultMap="persInfoResultMap" parameterType="String" >
  72. select <include refid="table_columns" /> from GW_SYS_PERS_INFO where ID = #{id}
  73. </select>
  74. <select id="getBy" resultMap="persInfoResultMap">
  75. select <include refid="table_columns" /> from GW_SYS_PERS_INFO <include refid="page_where" />
  76. </select>
  77. <select id="findAll" resultMap="persInfoResultMap">
  78. select <include refid="table_columns" /> from GW_SYS_PERS_INFO
  79. </select>
  80. <select id="findList" resultMap="persInfoResultMap">
  81. select
  82. <include refid="table_columns" />
  83. from GW_SYS_PERS_INFO
  84. <include refid="page_where" />
  85. ORDER BY INTM DESC
  86. </select>
  87. <select id="selectCount" resultType="int" >
  88. select nvl(count(ID), 0) from GW_SYS_PERS_INFO <include refid="page_where" />
  89. </select>
  90. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
  91. insert into GW_SYS_PERS_INFO( <include refid="table_columns" /> )
  92. values ( <include refid="entity_properties" /> )
  93. </insert>
  94. <delete id="delete" parameterType="java.lang.String">
  95. update GW_SYS_PERS_INFO set DATA_STAT='9' where ID = #{id}
  96. </delete>
  97. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
  98. update GW_SYS_PERS_INFO set DATA_STAT='9' <include refid="page_where" />
  99. </delete>
  100. <update id="deleteInFlag" parameterType="java.lang.String">
  101. update GW_SYS_PERS_INFO set DATA_STAT = '9' where ID = #{id}
  102. </update>
  103. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
  104. update GW_SYS_PERS_INFO
  105. <trim prefix="set" suffixOverrides=",">
  106. <if test="id != null and id != ''">ID = #{id},</if>
  107. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  108. <if test="recPersName != null and recPersName != ''">REC_PERS_NAME = #{recPersName},</if>
  109. <if test="sndPersId != null and sndPersId != ''">SND_PERS_ID = #{sndPersId},</if>
  110. <if test="sndPersName != null and sndPersName != ''">SND_PERS_NAME = #{sndPersName},</if>
  111. <if test="mssgType != null and mssgType != ''">MSSG_TYPE = #{mssgType},</if>
  112. <if test="mssg != null and mssg != ''">MSSG = #{mssg},</if>
  113. <if test="mssgClass != null and mssgClass != ''">MSSG_CLASS = #{mssgClass},</if>
  114. <if test="mssgParam != null and mssgParam != ''">MSSG_PARAM = #{mssgParam},</if>
  115. <if test="isRead != null and isRead != ''">IS_READ = #{isRead},</if>
  116. <if test="isHand != null and isHand != ''">IS_HAND = #{isHand},</if>
  117. <if test="intm != null">INTM = #{intm},</if>
  118. <if test="uptm != null">UPTM = #{uptm},</if>
  119. </trim>
  120. <where>ID = #{id}</where>
  121. </update>
  122. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.PersInfo">
  123. update GW_SYS_PERS_INFO
  124. <trim prefix="set" suffixOverrides=",">
  125. <if test="id != null and id != ''">ID = #{id},</if>
  126. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  127. <if test="recPersName != null and recPersName != ''">REC_PERS_NAME = #{recPersName},</if>
  128. <if test="sndPersId != null and sndPersId != ''">SND_PERS_ID = #{sndPersId},</if>
  129. <if test="sndPersName != null and sndPersName != ''">SND_PERS_NAME = #{sndPersName},</if>
  130. <if test="mssgType != null and mssgType != ''">MSSG_TYPE = #{mssgType},</if>
  131. <if test="mssg != null and mssg != ''">MSSG = #{mssg},</if>
  132. <if test="mssgClass != null and mssgClass != ''">MSSG_CLASS = #{mssgClass},</if>
  133. <if test="mssgParam != null and mssgParam != ''">MSSG_PARAM = #{mssgParam},</if>
  134. <if test="isRead != null and isRead != ''">IS_READ = #{isRead},</if>
  135. <if test="isHand != null and isHand != ''">IS_HAND = #{isHand},</if>
  136. <if test="intm != null">INTM = #{intm},</if>
  137. <if test="uptm != null">UPTM = #{uptm},</if>
  138. </trim>
  139. <include refid="page_where" />
  140. </update>
  141. <!-- 其他自定义SQL -->
  142. </mapper>