6b6ea3a2a7babedb666c6bfa1f5e8bc6417f37ff.svn-base 5.1 KB

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