PoIssuerMapper.xml 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.ruoyi.system.mapper.PoIssuerMapper">
  6. <resultMap type="PoIssuer" id="PoIssuerResult">
  7. <result property="issuerId" column="issuer_id" />
  8. <result property="issuerName" column="issuer_name" />
  9. <result property="issuerPhone" column="issuer_phone" />
  10. <result property="issuerAddress" column="issuer_address" />
  11. <result property="collectionTitle" column="collection_title" />
  12. <result property="createBy" column="create_by" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="remark" column="remark" />
  17. <result property="delFlag" column="del_flag" />
  18. </resultMap>
  19. <sql id="selectPoIssuerVo">
  20. select issuer_id, issuer_name, issuer_phone, issuer_address, collection_title, create_by, create_time, update_time, update_by, remark, del_flag from po_issuer
  21. </sql>
  22. <select id="selectPoIssuerList" parameterType="PoIssuer" resultMap="PoIssuerResult">
  23. <include refid="selectPoIssuerVo"/>
  24. <where>
  25. <if test="issuerName != null and issuerName != ''"> and issuer_name like concat('%', #{issuerName}, '%')</if>
  26. <if test="issuerPhone != null and issuerPhone != ''"> and issuer_phone = #{issuerPhone}</if>
  27. <if test="issuerAddress != null and issuerAddress != ''"> and issuer_address = #{issuerAddress}</if>
  28. <if test="collectionTitle != null and collectionTitle != ''"> and collection_title = #{collectionTitle}</if>
  29. </where>
  30. </select>
  31. <select id="selectPoIssuerByIssuerId" parameterType="Long" resultMap="PoIssuerResult">
  32. <include refid="selectPoIssuerVo"/>
  33. where issuer_id = #{issuerId}
  34. </select>
  35. <insert id="insertPoIssuer" parameterType="PoIssuer" useGeneratedKeys="true" keyProperty="issuerId">
  36. insert into po_issuer
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="issuerName != null and issuerName != ''">issuer_name,</if>
  39. <if test="issuerPhone != null and issuerPhone != ''">issuer_phone,</if>
  40. <if test="issuerAddress != null and issuerAddress != ''">issuer_address,</if>
  41. <if test="collectionTitle != null and collectionTitle != ''">collection_title,</if>
  42. <if test="createBy != null">create_by,</if>
  43. <if test="createTime != null">create_time,</if>
  44. <if test="updateTime != null">update_time,</if>
  45. <if test="updateBy != null">update_by,</if>
  46. <if test="remark != null">remark,</if>
  47. <if test="delFlag != null">del_flag,</if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides=",">
  50. <if test="issuerName != null and issuerName != ''">#{issuerName},</if>
  51. <if test="issuerPhone != null and issuerPhone != ''">#{issuerPhone},</if>
  52. <if test="issuerAddress != null and issuerAddress != ''">#{issuerAddress},</if>
  53. <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
  54. <if test="createBy != null">#{createBy},</if>
  55. <if test="createTime != null">#{createTime},</if>
  56. <if test="updateTime != null">#{updateTime},</if>
  57. <if test="updateBy != null">#{updateBy},</if>
  58. <if test="remark != null">#{remark},</if>
  59. <if test="delFlag != null">#{delFlag},</if>
  60. </trim>
  61. </insert>
  62. <update id="updatePoIssuer" parameterType="PoIssuer">
  63. update po_issuer
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="issuerName != null and issuerName != ''">issuer_name = #{issuerName},</if>
  66. <if test="issuerPhone != null and issuerPhone != ''">issuer_phone = #{issuerPhone},</if>
  67. <if test="issuerAddress != null and issuerAddress != ''">issuer_address = #{issuerAddress},</if>
  68. <if test="collectionTitle != null and collectionTitle != ''">collection_title = #{collectionTitle},</if>
  69. <if test="createBy != null">create_by = #{createBy},</if>
  70. <if test="createTime != null">create_time = #{createTime},</if>
  71. <if test="updateTime != null">update_time = #{updateTime},</if>
  72. <if test="updateBy != null">update_by = #{updateBy},</if>
  73. <if test="remark != null">remark = #{remark},</if>
  74. <if test="delFlag != null">del_flag = #{delFlag},</if>
  75. </trim>
  76. where issuer_id = #{issuerId}
  77. </update>
  78. <delete id="deletePoIssuerByIssuerId" parameterType="Long">
  79. delete from po_issuer where issuer_id = #{issuerId}
  80. </delete>
  81. <delete id="deletePoIssuerByIssuerIds" parameterType="String">
  82. delete from po_issuer where issuer_id in
  83. <foreach item="issuerId" collection="array" open="(" separator="," close=")">
  84. #{issuerId}
  85. </foreach>
  86. </delete>
  87. </mapper>