53c08c091d25fc8a9a2df4ce2c80ab20952e4daa.svn-base 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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.PersPositionViewLogDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.PersPositionViewLog" id="persPositionViewLogResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="orgId" column="ORG_ID"/>
  7. <result property="adCode" column="AD_CODE"/>
  8. <result property="adName" column="AD_NAME"/>
  9. <result property="persIdViewed" column="PERS_ID_VIEWED"/>
  10. <result property="persNameViewed" column="PERS_NAME_VIEWED"/>
  11. <result property="persName" column="PERS_NAME"/>
  12. <result property="persId" column="PERS_ID"/>
  13. <result property="intm" column="INTM"/>
  14. <result property="uptm" column="UPTM"/>
  15. <result property="note" column="NOTE"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. </resultMap>
  18. <sql id="table_columns">
  19. ID,
  20. ORG_ID,
  21. AD_CODE,
  22. AD_NAME,
  23. PERS_ID_VIEWED,
  24. PERS_NAME_VIEWED,
  25. PERS_NAME,
  26. PERS_ID,
  27. INTM,
  28. UPTM,
  29. NOTE,
  30. DATA_STAT
  31. </sql>
  32. <sql id="entity_properties">
  33. #{id},
  34. #{orgId},
  35. #{adCode},
  36. #{adName},
  37. #{persIdViewed},
  38. #{persNameViewed},
  39. #{persName},
  40. #{persId},
  41. #{intm},
  42. #{uptm},
  43. #{note},
  44. #{dataStat}
  45. </sql>
  46. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  47. <sql id="page_where">
  48. <trim prefix="where" prefixOverrides="and | or ">
  49. <if test="id != null and id != ''">and ID = #{id}</if>
  50. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  51. <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
  52. <if test="adName != null and adName != ''">and AD_NAME LIKE '%${adName}%'</if>
  53. <if test="persIdViewed != null and persIdViewed != ''">and PERS_ID_VIEWED = #{persIdViewed}</if>
  54. <if test="persNameViewed != null and persNameViewed != ''">and PERS_NAME_VIEWED LIKE '%${persNameViewed}%'</if>
  55. <if test="persName != null and persName != ''">and PERS_NAME LIKE '%${persName}%'</if>
  56. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  57. <if test="intm != null">and INTM = #{intm}</if>
  58. <if test="uptm != null">and UPTM = #{uptm}</if>
  59. <if test="sttm != null and sttm != '' and entm != null and entm != '' ">
  60. and INTM &gt;= TO_DATE(#{sttm}, 'YYYY-MM-DD') and INTM &lt; TO_DATE(#{entm}, 'YYYY-MM-DD') +1
  61. </if>
  62. <if test="note != null and note != ''">and NOTE = #{note}</if>
  63. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="persPositionViewLogResultMap" parameterType="String" >
  67. select <include refid="table_columns" /> from PERS_POSITION_VIEW_LOG where ID = #{id}
  68. </select>
  69. <select id="getBy" resultMap="persPositionViewLogResultMap">
  70. select <include refid="table_columns" /> from PERS_POSITION_VIEW_LOG <include refid="page_where" />
  71. </select>
  72. <select id="findAll" resultMap="persPositionViewLogResultMap">
  73. select <include refid="table_columns" /> from PERS_POSITION_VIEW_LOG
  74. </select>
  75. <select id="findList" resultMap="persPositionViewLogResultMap">
  76. select <include refid="table_columns" /> from PERS_POSITION_VIEW_LOG <include refid="page_where" />
  77. </select>
  78. <select id="selectCount" resultType="int" >
  79. select count(ID) from PERS_POSITION_VIEW_LOG <include refid="page_where" />
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.PersPositionViewLog">
  82. insert into PERS_POSITION_VIEW_LOG( <include refid="table_columns" /> )
  83. values ( <include refid="entity_properties" /> )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. update PERS_POSITION_VIEW_LOG set DATA_STAT='9' where ID = #{id}
  87. </delete>
  88. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.PersPositionViewLog">
  89. update PERS_POSITION_VIEW_LOG set DATA_STAT='9' <include refid="page_where" />
  90. </delete>
  91. <update id="deleteInFlag" parameterType="java.lang.String">
  92. update PERS_POSITION_VIEW_LOG set DATA_STAT='9' where ID = #{id}
  93. </update>
  94. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.PersPositionViewLog">
  95. update PERS_POSITION_VIEW_LOG
  96. <trim prefix="set" suffixOverrides=",">
  97. <if test="uptm != null">UPTM = #{uptm},</if>
  98. <if test="note != null and note != ''">NOTE = #{note},</if>
  99. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  100. </trim>
  101. <where>ID = #{id}</where>
  102. </update>
  103. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.PersPositionViewLog">
  104. update PERS_POSITION_VIEW_LOG
  105. <trim prefix="set" suffixOverrides=",">
  106. <if test="intm != null">INTM = #{intm},</if>
  107. <if test="uptm != null">UPTM = #{uptm},</if>
  108. <if test="note != null and note != ''">NOTE = #{note},</if>
  109. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  110. </trim>
  111. <include refid="page_where" />
  112. </update>
  113. <!-- 其他自定义SQL -->
  114. </mapper>