TacActiveLogDao.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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.TacActiveLogDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacActiveLog" id="tacActiveLogResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="regstrId" column="REGSTR_ID"/>
  7. <result property="type" column="TYPE"/>
  8. <result property="state" column="STATE"/>
  9. <result property="content" column="CONTENT"/>
  10. <result property="intm" column="INTM"/>
  11. <result property="note" column="NOTE"/>
  12. <result property="name" column="NAME"/>
  13. <result property="persid" column="PERSID"/>
  14. <result property="persName" column="PERS_NAME"/>
  15. <result property="stepId" column="STEP_ID"/>
  16. </resultMap>
  17. <sql id="table_columns">
  18. ID,STEP_ID,
  19. REGSTR_ID,
  20. TYPE,
  21. STATE,
  22. CONTENT,
  23. INTM,
  24. NOTE,
  25. NAME,
  26. PERSID,
  27. PERS_NAME
  28. </sql>
  29. <sql id="entity_properties">
  30. #{id},#{stepId},
  31. #{regstrId},
  32. #{type},
  33. #{state},
  34. #{content},
  35. #{intm},
  36. #{note},
  37. #{name},
  38. #{persid},
  39. #{persName}
  40. </sql>
  41. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  42. <sql id="page_where">
  43. <trim prefix="where" prefixOverrides="and | or ">
  44. <if test="regstrId != null and regstrId != ''">and REGSTR_ID = #{regstrId}</if>
  45. <if test="type != null and type != ''">and TYPE = #{type}</if>
  46. <if test="state != null and state != ''">and STATE = #{state}</if>
  47. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  48. <if test="intm != null">and INTM = #{intm}</if>
  49. <if test="note != null and note != ''">and NOTE = #{note}</if>
  50. <if test="name != null and name != ''">and NAME = #{name}</if>
  51. <if test="persid != null and persid != ''">and PERSID = #{persid}</if>
  52. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  53. </trim>
  54. </sql>
  55. <select id="get" resultMap="tacActiveLogResultMap" parameterType="String" >
  56. select <include refid="table_columns" /> from TAC_ACTIVE_LOG where ID = #{id}
  57. </select>
  58. <select id="getBy" resultMap="tacActiveLogResultMap">
  59. select <include refid="table_columns" /> from TAC_ACTIVE_LOG <include refid="page_where" />
  60. </select>
  61. <select id="findAll" resultMap="tacActiveLogResultMap">
  62. select <include refid="table_columns" /> from TAC_ACTIVE_LOG
  63. </select>
  64. <select id="findList" resultMap="tacActiveLogResultMap">
  65. select <include refid="table_columns" /> from TAC_ACTIVE_LOG <include refid="page_where" /> order by intm asc
  66. </select>
  67. <select id="selectCount" resultType="int" >
  68. select count(ID) from TAC_ACTIVE_LOG <include refid="page_where" />
  69. </select>
  70. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacActiveLog">
  71. insert into TAC_ACTIVE_LOG( <include refid="table_columns" /> )
  72. values ( <include refid="entity_properties" /> )
  73. </insert>
  74. <delete id="delete" parameterType="java.lang.String">
  75. delete from TAC_ACTIVE_LOG where ID = #{id}
  76. </delete>
  77. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacActiveLog">
  78. delete from TAC_ACTIVE_LOG <include refid="page_where" />
  79. </delete>
  80. <update id="deleteInFlag" parameterType="java.lang.String">
  81. update TAC_ACTIVE_LOG set flag_valid = 0 where ID = #{id}
  82. </update>
  83. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacActiveLog">
  84. update TAC_ACTIVE_LOG
  85. <trim prefix="set" suffixOverrides=",">
  86. <if test="regstrId != null and regstrId != ''">REGSTR_ID = #{regstrId},</if>
  87. <if test="type != null and type != ''">TYPE = #{type},</if>
  88. <if test="state != null and state != ''">STATE = #{state},</if>
  89. <if test="content != null and content != ''">CONTENT = #{content},</if>
  90. <if test="intm != null">INTM = #{intm},</if>
  91. <if test="note != null and note != ''">NOTE = #{note},</if>
  92. <if test="name != null and name != ''">NAME = #{name},</if>
  93. <if test="persid != null and persid != ''">PERSID = #{persid},</if>
  94. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  95. </trim>
  96. <where>ID = #{id}</where>
  97. </update>
  98. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacActiveLog">
  99. update TAC_ACTIVE_LOG
  100. <trim prefix="set" suffixOverrides=",">
  101. <if test="regstrId != null and regstrId != ''">REGSTR_ID = #{regstrId},</if>
  102. <if test="type != null and type != ''">TYPE = #{type},</if>
  103. <if test="state != null and state != ''">STATE = #{state},</if>
  104. <if test="content != null and content != ''">CONTENT = #{content},</if>
  105. <if test="intm != null">INTM = #{intm},</if>
  106. <if test="note != null and note != ''">NOTE = #{note},</if>
  107. <if test="name != null and name != ''">NAME = #{name},</if>
  108. <if test="persid != null and persid != ''">PERSID = #{persid},</if>
  109. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  110. </trim>
  111. <include refid="page_where" />
  112. </update>
  113. <!-- 其他自定义SQL -->
  114. </mapper>