1630ef66ecf36f19cf21f66bfe8a950a4da8b335.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.AttInspTypeDutyDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttInspTypeDuty" id="attInspTypeDutyResultMap">
  5. <result property="dutyDep" column="DUTY_DEP"/>
  6. <result property="ptype" column="PTYPE"/>
  7. <result property="orgId" column="ORG_ID"/>
  8. </resultMap>
  9. <sql id="table_columns">
  10. DUTY_DEP,
  11. PTYPE,
  12. ORG_ID
  13. </sql>
  14. <sql id="entity_properties">
  15. #{dutyDep},
  16. #{ptype},
  17. #{orgId}
  18. </sql>
  19. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  20. <sql id="page_where">
  21. <trim prefix="where" prefixOverrides="and | or ">
  22. <if test="dutyDep != null and dutyDep != ''">
  23. and DUTY_DEP = #{dutyDep}
  24. </if>
  25. <if test="ptype != null and ptype != ''">
  26. and PTYPE = #{ptype}
  27. </if>
  28. <if test="orgId != null and orgId != ''">
  29. and ORG_ID = #{orgId}
  30. </if>
  31. and DATA_STAT='0'
  32. </trim>
  33. </sql>
  34. <select id="get" resultMap="attInspTypeDutyResultMap" parameterType="String">
  35. select
  36. <include refid="table_columns"/>
  37. from ATT_INSP_TYPE_DUTY where ID = #{id}
  38. </select>
  39. <select id="getBy" resultMap="attInspTypeDutyResultMap">
  40. select
  41. <include refid="table_columns"/>
  42. from ATT_INSP_TYPE_DUTY
  43. <include refid="page_where"/>
  44. </select>
  45. <select id="findAll" resultMap="attInspTypeDutyResultMap">
  46. select
  47. <include refid="table_columns"/>
  48. from ATT_INSP_TYPE_DUTY
  49. </select>
  50. <select id="findList" resultMap="attInspTypeDutyResultMap">
  51. select
  52. <include refid="table_columns"/>
  53. from ATT_INSP_TYPE_DUTY
  54. <include refid="page_where"/>
  55. </select>
  56. <select id="selectCount" resultType="int">
  57. select count(ID) from ATT_INSP_TYPE_DUTY
  58. <include refid="page_where"/>
  59. </select>
  60. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
  61. insert into ATT_INSP_TYPE_DUTY(
  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. update ATT_INSP_TYPE_DUTY set DATA_STAT='9' where ID = #{id}
  70. </delete>
  71. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
  72. update ATT_INSP_TYPE_DUTY set DATA_STAT='9'
  73. <include refid="page_where"/>
  74. </delete>
  75. <update id="deleteInFlag" parameterType="java.lang.String">
  76. update ATT_INSP_TYPE_DUTY set DATA_STAT = '9' where ID = #{id}
  77. </update>
  78. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
  79. update ATT_INSP_TYPE_DUTY
  80. <trim prefix="set" suffixOverrides=",">
  81. <if test="dutyDep != null and dutyDep != ''">DUTY_DEP
  82. = #{dutyDep},
  83. </if>
  84. <if test="ptype != null and ptype != ''">PTYPE
  85. = #{ptype},
  86. </if>
  87. <if test="orgId != null and orgId != ''">ORG_ID
  88. = #{orgId},
  89. </if>
  90. </trim>
  91. <where>ID = #{id}</where>
  92. </update>
  93. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
  94. update ATT_INSP_TYPE_DUTY
  95. <trim prefix="set" suffixOverrides=",">
  96. <if test="dutyDep != null and dutyDep != ''">DUTY_DEP
  97. = #{dutyDep},
  98. </if>
  99. <if test="ptype != null and ptype != ''">PTYPE
  100. = #{ptype},
  101. </if>
  102. <if test="orgId != null and orgId != ''">ORG_ID
  103. = #{orgId},
  104. </if>
  105. </trim>
  106. <include refid="page_where"/>
  107. </update>
  108. <!-- 其他自定义SQL -->
  109. <select id="arrayByOrgId" resultType="java.lang.String">
  110. SELECT DISTINCT DUTY_DEP FROM ATT_INSP_TYPE_DUTY where ORG_ID = #{adCode}
  111. </select>
  112. </mapper>