NoticeDemandMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.dgtly.notice.mapper.NoticeDemandMapper">
  6. <resultMap type="NoticeDemand" id="NoticeDemandResult">
  7. <result property="id" column="id" />
  8. <result property="memberId" column="member_id" />
  9. <result property="purchaseTitle" column="purchase_title" />
  10. <result property="summaryOfNeeds" column="summary_of_needs" />
  11. <result property="demandDetails" column="demand_details" />
  12. <result property="contacts" column="contacts" />
  13. <result property="contactNumber" column="contact_number" />
  14. <result property="releaseTime" column="release_time" />
  15. <result property="status" column="status" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateBy" column="update_by" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="delFlag" column="del_flag" />
  21. <result property="remark" column="remark" />
  22. </resultMap>
  23. <sql id="selectNoticeDemandVo">
  24. select id, member_id, purchase_title, summary_of_needs, demand_details, contacts, contact_number, release_time, status, create_by, create_time, update_by, update_time, del_flag, remark from notice_demand
  25. </sql>
  26. <select id="selectNoticeDemandList" parameterType="NoticeDemand" resultMap="NoticeDemandResult">
  27. <include refid="selectNoticeDemandVo"/>
  28. <where>
  29. <if test="memberId != null "> and member_id = #{memberId}</if>
  30. <if test="purchaseTitle != null and purchaseTitle != ''"> and purchase_title = #{purchaseTitle}</if>
  31. <if test="summaryOfNeeds != null and summaryOfNeeds != ''"> and summary_of_needs = #{summaryOfNeeds}</if>
  32. <if test="demandDetails != null and demandDetails != ''"> and demand_details = #{demandDetails}</if>
  33. <if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
  34. <if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
  35. <if test="releaseTime != null "> and release_time = #{releaseTime}</if>
  36. <if test="status != null and status != ''"> and status = #{status}</if>
  37. </where>
  38. </select>
  39. <select id="selectNoticeDemandById" parameterType="Long" resultMap="NoticeDemandResult">
  40. <include refid="selectNoticeDemandVo"/>
  41. where id = #{id}
  42. </select>
  43. <insert id="insertNoticeDemand" parameterType="NoticeDemand" useGeneratedKeys="true" keyProperty="id">
  44. insert into notice_demand
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="memberId != null ">member_id,</if>
  47. <if test="purchaseTitle != null and purchaseTitle != ''">purchase_title,</if>
  48. <if test="summaryOfNeeds != null and summaryOfNeeds != ''">summary_of_needs,</if>
  49. <if test="demandDetails != null and demandDetails != ''">demand_details,</if>
  50. <if test="contacts != null and contacts != ''">contacts,</if>
  51. <if test="contactNumber != null and contactNumber != ''">contact_number,</if>
  52. <if test="releaseTime != null ">release_time,</if>
  53. <if test="status != null and status != ''">status,</if>
  54. <if test="createBy != null and createBy != ''">create_by,</if>
  55. <if test="createTime != null ">create_time,</if>
  56. <if test="updateBy != null and updateBy != ''">update_by,</if>
  57. <if test="updateTime != null ">update_time,</if>
  58. <if test="delFlag != null and delFlag != ''">del_flag,</if>
  59. <if test="remark != null and remark != ''">remark,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="memberId != null ">#{memberId},</if>
  63. <if test="purchaseTitle != null and purchaseTitle != ''">#{purchaseTitle},</if>
  64. <if test="summaryOfNeeds != null and summaryOfNeeds != ''">#{summaryOfNeeds},</if>
  65. <if test="demandDetails != null and demandDetails != ''">#{demandDetails},</if>
  66. <if test="contacts != null and contacts != ''">#{contacts},</if>
  67. <if test="contactNumber != null and contactNumber != ''">#{contactNumber},</if>
  68. <if test="releaseTime != null ">#{releaseTime},</if>
  69. <if test="status != null and status != ''">#{status},</if>
  70. <if test="createBy != null and createBy != ''">#{createBy},</if>
  71. <if test="createTime != null ">#{createTime},</if>
  72. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  73. <if test="updateTime != null ">#{updateTime},</if>
  74. <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
  75. <if test="remark != null and remark != ''">#{remark},</if>
  76. </trim>
  77. </insert>
  78. <update id="updateNoticeDemand" parameterType="NoticeDemand">
  79. update notice_demand
  80. <trim prefix="SET" suffixOverrides=",">
  81. <if test="memberId != null ">member_id = #{memberId},</if>
  82. <if test="purchaseTitle != null and purchaseTitle != ''">purchase_title = #{purchaseTitle},</if>
  83. <if test="summaryOfNeeds != null and summaryOfNeeds != ''">summary_of_needs = #{summaryOfNeeds},</if>
  84. <if test="demandDetails != null and demandDetails != ''">demand_details = #{demandDetails},</if>
  85. <if test="contacts != null and contacts != ''">contacts = #{contacts},</if>
  86. <if test="contactNumber != null and contactNumber != ''">contact_number = #{contactNumber},</if>
  87. <if test="releaseTime != null ">release_time = #{releaseTime},</if>
  88. <if test="status != null and status != ''">status = #{status},</if>
  89. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  90. <if test="createTime != null ">create_time = #{createTime},</if>
  91. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  92. <if test="updateTime != null ">update_time = #{updateTime},</if>
  93. <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
  94. <if test="remark != null and remark != ''">remark = #{remark},</if>
  95. </trim>
  96. where id = #{id}
  97. </update>
  98. <delete id="deleteNoticeDemandById" parameterType="Long">
  99. delete from notice_demand where id = #{id}
  100. </delete>
  101. <delete id="deleteNoticeDemandByIds" parameterType="String">
  102. delete from notice_demand where id in
  103. <foreach item="id" collection="array" open="(" separator="," close=")">
  104. #{id}
  105. </foreach>
  106. </delete>
  107. </mapper>