BisInspOffLineDao.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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.BisInspOffLineDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspOffLine" id="bisInspOffLineResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="code" column="CODE"/>
  7. <result property="ptype" column="PTYPE"/>
  8. <result property="name" column="NAME"/>
  9. <result property="villType" column="VILL_TYPE"/>
  10. <result property="groupId" column="GROUP_ID"/>
  11. <result property="addvcd" column="ADDVCD"/>
  12. <result property="persId" column="PERS_ID"/>
  13. <result property="intm" column="INTM"/>
  14. <result property="uptm" column="UPTM"/>
  15. <result property="dataStat" column="DATA_STAT"/>
  16. </resultMap>
  17. <sql id="table_columns">
  18. ID,
  19. CODE,
  20. PTYPE,
  21. NAME,
  22. VILL_TYPE,
  23. GROUP_ID,
  24. ADDVCD,
  25. PERS_ID,
  26. INTM,
  27. UPTM,
  28. DATA_STAT
  29. </sql>
  30. <sql id="entity_properties">
  31. #{id},
  32. #{code},
  33. #{ptype},
  34. #{name},
  35. #{villType},
  36. #{groupId},
  37. #{addvcd},
  38. #{persId},
  39. #{intm},
  40. #{uptm},
  41. #{dataStat}
  42. </sql>
  43. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  44. <sql id="page_where">
  45. <trim prefix="where" prefixOverrides="and | or ">
  46. <if test="code != null and code != ''">and CODE = #{code}</if>
  47. <if test="ptype != null and ptype != ''">and PTYPE = #{ptype}</if>
  48. <if test="name != null and name != ''">and NAME = #{name}</if>
  49. <if test="villType != null and villType != ''">and VILL_TYPE = #{villType}</if>
  50. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  51. <if test="addvcd != null and addvcd != ''">and ADDVCD = #{addvcd}</if>
  52. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  53. <if test="intm != null">and INTM = #{intm}</if>
  54. <if test="uptm != null">and UPTM = #{uptm}</if>
  55. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  56. </trim>
  57. </sql>
  58. <select id="get" resultMap="bisInspOffLineResultMap" parameterType="String" >
  59. select <include refid="table_columns" /> from BIS_INSP_OFF_LINE where ID = #{id}
  60. </select>
  61. <select id="getBy" resultMap="bisInspOffLineResultMap">
  62. select <include refid="table_columns" /> from BIS_INSP_OFF_LINE <include refid="page_where" />
  63. </select>
  64. <select id="findAll" resultMap="bisInspOffLineResultMap">
  65. select <include refid="table_columns" /> from BIS_INSP_OFF_LINE
  66. </select>
  67. <select id="findList" resultMap="bisInspOffLineResultMap">
  68. select <include refid="table_columns" /> from BIS_INSP_OFF_LINE <include refid="page_where" />
  69. </select>
  70. <select id="selectCount" resultType="int" >
  71. select count(ID) from BIS_INSP_OFF_LINE <include refid="page_where" />
  72. </select>
  73. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspOffLine">
  74. insert into BIS_INSP_OFF_LINE( <include refid="table_columns" /> )
  75. values ( <include refid="entity_properties" /> )
  76. </insert>
  77. <delete id="delete" parameterType="java.lang.String">
  78. update from BIS_INSP_OFF_LINE set DATA_STAT='9' where ID = #{id}
  79. </delete>
  80. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspOffLine">
  81. delete from BIS_INSP_OFF_LINE <include refid="page_where" />
  82. </delete>
  83. <update id="deleteInFlag" parameterType="java.lang.String">
  84. update BIS_INSP_OFF_LINE set flag_valid = 0 where ID = #{id}
  85. </update>
  86. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspOffLine">
  87. update BIS_INSP_OFF_LINE
  88. <trim prefix="set" suffixOverrides=",">
  89. <if test="code != null and code != ''">CODE = #{code},</if>
  90. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  91. <if test="name != null and name != ''">NAME = #{name},</if>
  92. <if test="villType != null and villType != ''">VILL_TYPE = #{villType},</if>
  93. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  94. <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
  95. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  96. <if test="intm != null">INTM = #{intm},</if>
  97. <if test="uptm != null">UPTM = #{uptm},</if>
  98. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  99. </trim>
  100. <where>ID = #{id}</where>
  101. </update>
  102. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspOffLine">
  103. update BIS_INSP_OFF_LINE
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="code != null and code != ''">CODE = #{code},</if>
  106. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  107. <if test="name != null and name != ''">NAME = #{name},</if>
  108. <if test="villType != null and villType != ''">VILL_TYPE = #{villType},</if>
  109. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  110. <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
  111. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  112. <if test="intm != null">INTM = #{intm},</if>
  113. <if test="uptm != null">UPTM = #{uptm},</if>
  114. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  115. </trim>
  116. <include refid="page_where" />
  117. </update>
  118. <!-- 其他自定义SQL -->
  119. </mapper>