FgwFjMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.fgw.FgwFjMapper">
  6. <resultMap type="FgwFj" id="FgwFjResult">
  7. <result property="id" column="id" />
  8. <result property="xmId" column="xm_id" />
  9. <result property="xmbh" column="xmbh" />
  10. <result property="sourceId" column="source_id" />
  11. <result property="fjName" column="fj_name" />
  12. <result property="path" column="path" />
  13. <result property="type" column="type" />
  14. <result property="remark" column="remark" />
  15. <result property="isSh" column="is_sh" />
  16. </resultMap>
  17. <sql id="selectFgwFjVo">
  18. select id, xm_id, xmbh,source_id, fj_name, path, type, remark,is_sh from fgw_fj
  19. </sql>
  20. <select id="selectFgwFjList" parameterType="FgwFj" resultMap="FgwFjResult">
  21. <include refid="selectFgwFjVo"/>
  22. <where>
  23. <if test="xmId != null "> and xm_id = #{xmId}</if>
  24. <if test="xmbh != null and xmbh != ''"> and xmbh = #{xmbh}</if>
  25. <if test="sourceId != null "> and source_id = #{sourceId}</if>
  26. <if test="fjName != null and fjName != ''"> and fj_name like concat('%', #{fjName}, '%')</if>
  27. <if test="path != null and path != ''"> and path = #{path}</if>
  28. <if test="type != null and type != ''"> and type = #{type}</if>
  29. <if test="isSh != null and isSh != ''"> and is_sh = #{isSh}</if>
  30. </where>
  31. </select>
  32. <select id="selectFgwFjById" parameterType="Long" resultMap="FgwFjResult">
  33. <include refid="selectFgwFjVo"/>
  34. where id = #{id}
  35. </select>
  36. <select id="selectFgwFjByXmId" parameterType="Long" resultMap="FgwFjResult">
  37. <include refid="selectFgwFjVo"/>
  38. where xm_id = #{id} and type != '18'
  39. </select>
  40. <select id="selectFgwFjBySourceId" parameterType="Long" resultMap="FgwFjResult">
  41. <include refid="selectFgwFjVo"/>
  42. where source_id = #{id} and type = '18'
  43. </select>
  44. <insert id="insertFgwFj" parameterType="FgwFj" useGeneratedKeys="true" keyProperty="id">
  45. insert into fgw_fj
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="xmId != null">xm_id,</if>
  48. <if test="xmbh != null">xmbh,</if>
  49. <if test="sourceId != null">source_id,</if>
  50. <if test="fjName != null and fjName != ''">fj_name,</if>
  51. <if test="path != null">path,</if>
  52. <if test="type != null">type,</if>
  53. <if test="remark != null">remark,</if>
  54. <if test="isSh != null and isSh != ''">is_sh,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="xmId != null">#{xmId},</if>
  58. <if test="xmbh != null">#{xmbh},</if>
  59. <if test="sourceId != null">#{sourceId},</if>
  60. <if test="fjName != null and fjName != ''">#{fjName},</if>
  61. <if test="path != null">#{path},</if>
  62. <if test="type != null">#{type},</if>
  63. <if test="remark != null">#{remark},</if>
  64. <if test="isSh != null and isSh != ''">#{isSh},</if>
  65. </trim>
  66. </insert>
  67. <update id="updateFgwFj" parameterType="FgwFj">
  68. update fgw_fj
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="xmId != null">xm_id = #{xmId},</if>
  71. <if test="xmbh != null">xmbh = #{xmbh},</if>
  72. <if test="fjName != null and fjName != ''">fj_name = #{fjName},</if>
  73. <if test="path != null">path = #{path},</if>
  74. <if test="type != null">type = #{type},</if>
  75. <if test="remark != null">remark = #{remark},</if>
  76. <if test="isSh != null and isSh != ''">is_sh = #{isSh},</if>
  77. </trim>
  78. where id = #{id}
  79. </update>
  80. <delete id="deleteFgwFjById" parameterType="Long">
  81. delete from fgw_fj where id = #{id}
  82. </delete>
  83. <delete id="deleteFgwFjByIds" parameterType="String">
  84. delete from fgw_fj where id in
  85. <foreach item="id" collection="array" open="(" separator="," close=")">
  86. #{id}
  87. </foreach>
  88. </delete>
  89. <delete id="deleteFgwFjByXmId" parameterType="Long">
  90. delete from fgw_fj where xm_id = #{id} and is_sh != '2'
  91. <if test="type != null and type == 18"> and type = #{type}</if>
  92. <if test="type != null and type != 18"> and type != '18'</if>
  93. </delete>
  94. </mapper>