BisInspPblmPlistOrgDao.xml 4.8 KB

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