TacProvincePlanTaskDao.xml 5.4 KB

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