TacPersLableDao.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.TacPersLableDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPersLable" id="tacPersLableResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="persId" column="PERS_ID"/>
  7. <result property="tag" column="TAG"/>
  8. <result property="ctPersId" column="CT_PERS_ID"/>
  9. <result property="inTm" column="IN_TM"/>
  10. <result property="upTm" column="UP_TM"/>
  11. </resultMap>
  12. <sql id="table_columns">
  13. ID,
  14. PERS_ID,
  15. TAG,
  16. CT_PERS_ID,
  17. IN_TM,
  18. UP_TM
  19. </sql>
  20. <sql id="entity_properties">
  21. #{id},
  22. #{persId},
  23. #{tag},
  24. #{ctPersId},
  25. #{inTm},
  26. #{upTm}
  27. </sql>
  28. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  29. <sql id="page_where">
  30. <trim prefix="where" prefixOverrides="and | or ">
  31. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  32. <if test="tag != null and tag != ''">and TAG = #{tag}</if>
  33. <if test="ctPersId != null and ctPersId != ''">and CT_PERS_ID = #{ctPersId}</if>
  34. <if test="inTm != null">and IN_TM = #{inTm}</if>
  35. <if test="upTm != null">and UP_TM = #{upTm}</if>
  36. </trim>
  37. </sql>
  38. <select id="get" resultMap="tacPersLableResultMap" parameterType="String" >
  39. select <include refid="table_columns" /> from TAC_PERS_LABLE where ID = #{id}
  40. </select>
  41. <select id="getBy" resultMap="tacPersLableResultMap">
  42. select <include refid="table_columns" /> from TAC_PERS_LABLE <include refid="page_where" />
  43. </select>
  44. <select id="findAll" resultMap="tacPersLableResultMap">
  45. select <include refid="table_columns" /> from TAC_PERS_LABLE
  46. </select>
  47. <select id="findList" resultMap="tacPersLableResultMap">
  48. select <include refid="table_columns" /> from TAC_PERS_LABLE <include refid="page_where" />
  49. </select>
  50. <select id="selectCount" resultType="int" >
  51. select count(ID) from TAC_PERS_LABLE <include refid="page_where" />
  52. </select>
  53. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPersLable">
  54. insert into TAC_PERS_LABLE( <include refid="table_columns" /> )
  55. values ( <include refid="entity_properties" /> )
  56. </insert>
  57. <delete id="delete" parameterType="java.lang.String">
  58. delete from TAC_PERS_LABLE where ID = #{id}
  59. </delete>
  60. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPersLable">
  61. delete from TAC_PERS_LABLE <include refid="page_where" />
  62. </delete>
  63. <update id="deleteInFlag" parameterType="java.lang.String">
  64. update TAC_PERS_LABLE set flag_valid = 0 where ID = #{id}
  65. </update>
  66. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPersLable">
  67. update TAC_PERS_LABLE
  68. <trim prefix="set" suffixOverrides=",">
  69. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  70. <if test="tag != null and tag != ''">TAG = #{tag},</if>
  71. <if test="ctPersId != null and ctPersId != ''">CT_PERS_ID = #{ctPersId},</if>
  72. <if test="inTm != null">IN_TM = #{inTm},</if>
  73. <if test="upTm != null">UP_TM = #{upTm},</if>
  74. </trim>
  75. <where>ID = #{id}</where>
  76. </update>
  77. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPersLable">
  78. update TAC_PERS_LABLE
  79. <trim prefix="set" suffixOverrides=",">
  80. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  81. <if test="tag != null and tag != ''">TAG = #{tag},</if>
  82. <if test="ctPersId != null and ctPersId != ''">CT_PERS_ID = #{ctPersId},</if>
  83. <if test="inTm != null">IN_TM = #{inTm},</if>
  84. <if test="upTm != null">UP_TM = #{upTm},</if>
  85. </trim>
  86. <include refid="page_where" />
  87. </update>
  88. <!-- 其他自定义SQL -->
  89. </mapper>