BisInspMeetDiscussPersDao.xml 5.5 KB

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