BisInspPlanDpDao.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.BisInspPlanDpDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlanDp" id="bisInspPlanDpResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="dpName" column="DP_NAME"/>
  7. <result property="dpType" column="DP_TYPE"/>
  8. <result property="persId" column="PERS_ID"/>
  9. <result property="intm" column="INTM"/>
  10. <result property="uptm" column="UPTM"/>
  11. <result property="dataStat" column="DATA_STAT"/>
  12. <result property="adCode" column="AD_CODE"/>
  13. </resultMap>
  14. <sql id="table_columns">
  15. ID,
  16. DP_NAME,
  17. DP_TYPE,
  18. PERS_ID,
  19. INTM,
  20. UPTM,
  21. DATA_STAT,
  22. AD_CODE
  23. </sql>
  24. <sql id="entity_properties">
  25. #{id},
  26. #{dpName},
  27. #{dpType},
  28. #{persId},
  29. #{intm},
  30. #{uptm},
  31. #{dataStat},
  32. #{adCode}
  33. </sql>
  34. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  35. <sql id="page_where">
  36. <trim prefix="where" prefixOverrides="and | or ">
  37. <if test="dpName != null and dpName != ''">and DP_NAME = #{dpName}</if>
  38. <if test="dpType != null and dpType != ''">and DP_TYPE = #{dpType}</if>
  39. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  40. <if test="intm != null">and INTM = #{intm}</if>
  41. <if test="uptm != null">and UPTM = #{uptm}</if>
  42. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  43. <if test="ids != null and ids != ''">and ID in (${ids})</if>
  44. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  45. and DATA_STAT='0'
  46. </trim>
  47. </sql>
  48. <select id="get" resultMap="bisInspPlanDpResultMap" parameterType="String">
  49. select
  50. <include refid="table_columns"/>
  51. from BIS_INSP_PLAN_DP where ID = #{id}
  52. </select>
  53. <select id="getBy" resultMap="bisInspPlanDpResultMap">
  54. select
  55. <include refid="table_columns"/>
  56. from BIS_INSP_PLAN_DP
  57. <include refid="page_where"/>
  58. </select>
  59. <select id="findAll" resultMap="bisInspPlanDpResultMap">
  60. select
  61. <include refid="table_columns"/>
  62. from BIS_INSP_PLAN_DP
  63. </select>
  64. <select id="findList" resultMap="bisInspPlanDpResultMap">
  65. select
  66. <include refid="table_columns"/>
  67. from BIS_INSP_PLAN_DP
  68. <include refid="page_where"/>
  69. </select>
  70. <select id="selectCount" resultType="int">
  71. select count(ID) from BIS_INSP_PLAN_DP
  72. <include refid="page_where"/>
  73. </select>
  74. <select id="getByPersId" resultType="cn.com.goldenwater.dcproj.model.BisInspPlanDp">
  75. SELECT * FROM BIS_INSP_PLAN_DP WHERE ID = (select PLAN_DP_ID from BIS_INSP_ALL_RLATION_PERS where GUID=#{id})
  76. </select>
  77. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDp">
  78. insert into BIS_INSP_PLAN_DP(
  79. <include refid="table_columns"/>
  80. )
  81. values (
  82. <include refid="entity_properties"/>
  83. )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. update BIS_INSP_PLAN_DP
  87. set DATA_STAT='9'
  88. where ID = #{id}
  89. </delete>
  90. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDp">
  91. update BIS_INSP_PLAN_DP set DATA_STAT='9'
  92. <include refid="page_where"/>
  93. </delete>
  94. <update id="deleteInFlag" parameterType="java.lang.String">
  95. update BIS_INSP_PLAN_DP
  96. set DATA_STAT = '9'
  97. where ID = #{id}
  98. </update>
  99. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDp">
  100. update BIS_INSP_PLAN_DP
  101. <trim prefix="set" suffixOverrides=",">
  102. <if test="dpName != null and dpName != ''">DP_NAME = #{dpName},</if>
  103. <if test="dpType != null and dpType != ''">DP_TYPE = #{dpType},</if>
  104. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  105. <if test="intm != null">INTM = #{intm},</if>
  106. <if test="uptm != null">UPTM = #{uptm},</if>
  107. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  108. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  109. </trim>
  110. <where>ID = #{id}</where>
  111. </update>
  112. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanDp">
  113. update BIS_INSP_PLAN_DP
  114. <trim prefix="set" suffixOverrides=",">
  115. <if test="dpName != null and dpName != ''">DP_NAME = #{dpName},</if>
  116. <if test="dpType != null and dpType != ''">DP_TYPE = #{dpType},</if>
  117. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  118. <if test="intm != null">INTM = #{intm},</if>
  119. <if test="uptm != null">UPTM = #{uptm},</if>
  120. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  121. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  122. </trim>
  123. <include refid="page_where"/>
  124. </update>
  125. <!-- 其他自定义SQL -->
  126. </mapper>