ZsyzFjMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.projectV2.ZsyzFjMapper">
  6. <resultMap type="ZsyzFj" id="ZsyzFjResult">
  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. </resultMap>
  16. <sql id="selectZsyzFjVo">
  17. select id, xm_id, xmbh, source_id, fj_name, path, type, remark from zsyz_fj
  18. </sql>
  19. <select id="selectZsyzFjList" parameterType="ZsyzFj" resultMap="ZsyzFjResult">
  20. <include refid="selectZsyzFjVo"/>
  21. <where>
  22. <if test="xmId != null "> and xm_id = #{xmId}</if>
  23. <if test="xmbh != null and xmbh != ''"> and xmbh = #{xmbh}</if>
  24. <if test="sourceId != null "> and source_id = #{sourceId}</if>
  25. <if test="fjName != null and fjName != ''"> and fj_name like concat('%', #{fjName}, '%')</if>
  26. <if test="path != null and path != ''"> and path = #{path}</if>
  27. <if test="type != null and type != ''"> and type = #{type}</if>
  28. </where>
  29. </select>
  30. <select id="selectZsyzFjById" parameterType="Long" resultMap="ZsyzFjResult">
  31. <include refid="selectZsyzFjVo"/>
  32. where id = #{id}
  33. </select>
  34. <insert id="insertZsyzFj" parameterType="ZsyzFj" useGeneratedKeys="true" keyProperty="id">
  35. insert into zsyz_fj
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="xmId != null">xm_id,</if>
  38. <if test="xmbh != null">xmbh,</if>
  39. <if test="sourceId != null">source_id,</if>
  40. <if test="fjName != null and fjName != ''">fj_name,</if>
  41. <if test="path != null">path,</if>
  42. <if test="type != null">type,</if>
  43. <if test="remark != null">remark,</if>
  44. </trim>
  45. <trim prefix="values (" suffix=")" suffixOverrides=",">
  46. <if test="xmId != null">#{xmId},</if>
  47. <if test="xmbh != null">#{xmbh},</if>
  48. <if test="sourceId != null">#{sourceId},</if>
  49. <if test="fjName != null and fjName != ''">#{fjName},</if>
  50. <if test="path != null">#{path},</if>
  51. <if test="type != null">#{type},</if>
  52. <if test="remark != null">#{remark},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateZsyzFj" parameterType="ZsyzFj">
  56. update zsyz_fj
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="xmId != null">xm_id = #{xmId},</if>
  59. <if test="xmbh != null">xmbh = #{xmbh},</if>
  60. <if test="sourceId != null">source_id = #{sourceId},</if>
  61. <if test="fjName != null and fjName != ''">fj_name = #{fjName},</if>
  62. <if test="path != null">path = #{path},</if>
  63. <if test="type != null">type = #{type},</if>
  64. <if test="remark != null">remark = #{remark},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. <delete id="deleteZsyzFjById" parameterType="Long">
  69. delete from zsyz_fj where id = #{id}
  70. </delete>
  71. <delete id="deleteZsyzFjByIds" parameterType="String">
  72. delete from zsyz_fj where id in
  73. <foreach item="id" collection="array" open="(" separator="," close=")">
  74. #{id}
  75. </foreach>
  76. </delete>
  77. </mapper>