BisInspComPblmDao.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.BisInspComPblmDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspComPblm" id="bisInspComPblmResultMap">
  5. <result property="cpId" column="CP_ID"/>
  6. <result property="cpTitle" column="CP_TITLE"/>
  7. <result property="cpDesc" column="CP_DESC"/>
  8. <result property="cpLgtd" column="CP_LGTD"/>
  9. <result property="cpLttd" column="CP_LTTD"/>
  10. <result property="cpIttm" column="CP_ITTM"/>
  11. <result property="cpRes" column="CP_RES"/>
  12. <result property="cpResnm" column="CP_RESNM"/>
  13. </resultMap>
  14. <sql id="table_columns">
  15. CP_ID,
  16. CP_TITLE,
  17. CP_DESC,
  18. CP_LGTD,
  19. CP_LTTD,
  20. CP_ITTM,
  21. CP_RES,
  22. CP_RESNM
  23. </sql>
  24. <sql id="entity_properties">
  25. #{cpId},
  26. #{cpTitle},
  27. #{cpDesc},
  28. #{cpLgtd},
  29. #{cpLttd},
  30. #{cpIttm},
  31. #{cpRes},
  32. #{cpResnm}
  33. </sql>
  34. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  35. <sql id="page_where">
  36. <trim prefix="where" prefixOverrides="and | or ">
  37. <if test="cpTitle != null and cpTitle != ''">and CP_TITLE = #{cpTitle}</if>
  38. <if test="cpDesc != null and cpDesc != ''">and CP_DESC = #{cpDesc}</if>
  39. <if test="cpLgtd != null and cpLgtd != ''">and CP_LGTD = #{cpLgtd}</if>
  40. <if test="cpLttd != null and cpLttd != ''">and CP_LTTD = #{cpLttd}</if>
  41. <if test="cpIttm != null">and CP_ITTM = #{cpIttm}</if>
  42. <if test="cpRes != null and cpRes != ''">and CP_RES = #{cpRes}</if>
  43. <if test="cpResnm != null and cpResnm != ''">and CP_RESNM = #{cpResnm}</if>
  44. </trim>
  45. </sql>
  46. <sql id="page_where2">
  47. <trim prefix="where" prefixOverrides="and | or ">
  48. <if test="cpTitle != null and cpTitle != ''">and CP_TITLE like '%' || #{cpTitle} || '%'</if>
  49. <if test="cpDesc != null and cpDesc != ''">and CP_DESC like '%' || #{cpDesc} || '%'</if>
  50. <if test="cpLgtd != null and cpLgtd != ''">and CP_LGTD = #{cpLgtd}</if>
  51. <if test="cpLttd != null and cpLttd != ''">and CP_LTTD = #{cpLttd}</if>
  52. <if test="sttm != null">and CP_ITTM &gt;= #{sttm}</if>
  53. <if test="entm != null">and CP_ITTM &lt;= #{entm}</if>
  54. <if test="cpRes != null and cpRes != ''">and CP_RES = #{cpRes}</if>
  55. <if test="cpResnm != null and cpResnm != ''">and CP_RESNM = #{cpResnm}</if>
  56. </trim>
  57. </sql>
  58. <select id="get" resultMap="bisInspComPblmResultMap" parameterType="String">
  59. select
  60. <include refid="table_columns"/>
  61. from BIS_INSP_COM_PBLM where CP_ID = #{cpId}
  62. </select>
  63. <select id="getBy" resultMap="bisInspComPblmResultMap">
  64. select
  65. <include refid="table_columns"/>
  66. from BIS_INSP_COM_PBLM
  67. <include refid="page_where"/>
  68. </select>
  69. <select id="findAll" resultMap="bisInspComPblmResultMap">
  70. select
  71. <include refid="table_columns"/>
  72. from BIS_INSP_COM_PBLM
  73. </select>
  74. <select id="findList" resultMap="bisInspComPblmResultMap">
  75. select
  76. <include refid="table_columns"/>
  77. from BIS_INSP_COM_PBLM
  78. <include refid="page_where2"/>
  79. </select>
  80. <select id="selectCount" resultType="int">
  81. select count(CP_ID) from BIS_INSP_COM_PBLM
  82. <include refid="page_where"/>
  83. </select>
  84. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
  85. insert into BIS_INSP_COM_PBLM(
  86. <include refid="table_columns"/>
  87. )
  88. values (
  89. <include refid="entity_properties"/>
  90. )
  91. </insert>
  92. <delete id="delete" parameterType="java.lang.String">
  93. delete from BIS_INSP_COM_PBLM where CP_ID = #{cpId}
  94. </delete>
  95. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
  96. delete from BIS_INSP_COM_PBLM
  97. <include refid="page_where"/>
  98. </delete>
  99. <update id="deleteInFlag" parameterType="java.lang.String">
  100. update BIS_INSP_COM_PBLM set flag_valid = 0 where CP_ID = #{cpId}
  101. </update>
  102. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
  103. update BIS_INSP_COM_PBLM
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="cpTitle != null and cpTitle != ''">CP_TITLE = #{cpTitle},</if>
  106. <if test="cpDesc != null and cpDesc != ''">CP_DESC = #{cpDesc},</if>
  107. <if test="cpLgtd != null and cpLgtd != ''">CP_LGTD = #{cpLgtd},</if>
  108. <if test="cpLttd != null and cpLttd != ''">CP_LTTD = #{cpLttd},</if>
  109. <if test="cpIttm != null">CP_ITTM = #{cpIttm},</if>
  110. <if test="cpRes != null and cpRes != ''">CP_RES = #{cpRes},</if>
  111. <if test="cpResnm != null and cpResnm != ''">CP_RESNM = #{cpResnm},</if>
  112. </trim>
  113. <where>CP_ID = #{cpId}</where>
  114. </update>
  115. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
  116. update BIS_INSP_COM_PBLM
  117. <trim prefix="set" suffixOverrides=",">
  118. <if test="cpTitle != null and cpTitle != ''">CP_TITLE = #{cpTitle},</if>
  119. <if test="cpDesc != null and cpDesc != ''">CP_DESC = #{cpDesc},</if>
  120. <if test="cpLgtd != null and cpLgtd != ''">CP_LGTD = #{cpLgtd},</if>
  121. <if test="cpLttd != null and cpLttd != ''">CP_LTTD = #{cpLttd},</if>
  122. <if test="cpIttm != null">CP_ITTM = #{cpIttm},</if>
  123. <if test="cpRes != null and cpRes != ''">CP_RES = #{cpRes},</if>
  124. <if test="cpResnm != null and cpResnm != ''">CP_RESNM = #{cpResnm},</if>
  125. </trim>
  126. <include refid="page_where"/>
  127. </update>
  128. <!-- 其他自定义SQL -->
  129. </mapper>