RelRectNotOrgDao.xml 4.1 KB

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