BisInspLocalConfigDao.xml 4.0 KB

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