InvestigateTableMapper.xml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.InvestigateTableMapper">
  6. <resultMap type="InvestigateTable" id="InvestigateTableResult">
  7. <result property="investigateTableId" column="investigate_table_id" />
  8. <result property="investigateName" column="investigate_name" />
  9. <result property="content" column="content" />
  10. <result property="endTime" column="end_time" />
  11. <result property="cipher" column="cipher" />
  12. <result property="createBy" column="create_by" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="remark" column="remark" />
  17. </resultMap>
  18. <sql id="selectInvestigateTableVo">
  19. select investigate_table_id, investigate_name, content, end_time, cipher, create_by, create_time, update_by, update_time, remark from investigate_table
  20. </sql>
  21. <select id="selectInvestigateTableList" parameterType="InvestigateTable" resultMap="InvestigateTableResult">
  22. <include refid="selectInvestigateTableVo"/>
  23. <where>
  24. <if test="investigateName != null and investigateName != ''"> and investigate_name like concat('%', #{investigateName}, '%')</if>
  25. <if test="content != null and content != ''"> and content = #{content}</if>
  26. <if test="endTime != null "> and end_time = #{endTime}</if>
  27. <if test="cipher != null and cipher != ''"> and cipher = #{cipher}</if>
  28. </where>
  29. </select>
  30. <select id="selectInvestigateTableById" parameterType="Long" resultMap="InvestigateTableResult">
  31. <include refid="selectInvestigateTableVo"/>
  32. where investigate_table_id = #{investigateTableId}
  33. </select>
  34. <insert id="insertInvestigateTable" parameterType="InvestigateTable" useGeneratedKeys="true" keyProperty="id">
  35. insert into investigate_table
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="investigateName != null">investigate_name,</if>
  38. <if test="content != null">content,</if>
  39. <if test="endTime != null">end_time,</if>
  40. <if test="cipher != null">cipher,</if>
  41. <if test="createBy != null">create_by,</if>
  42. <if test="createTime != null">create_time,</if>
  43. <if test="updateBy != null">update_by,</if>
  44. <if test="updateTime != null">update_time,</if>
  45. <if test="remark != null">remark,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="investigateName != null">#{investigateName},</if>
  49. <if test="content != null">#{content},</if>
  50. <if test="endTime != null">#{endTime},</if>
  51. <if test="cipher != null">#{cipher},</if>
  52. <if test="createBy != null">#{createBy},</if>
  53. <if test="createTime != null">#{createTime},</if>
  54. <if test="updateBy != null">#{updateBy},</if>
  55. <if test="updateTime != null">#{updateTime},</if>
  56. <if test="remark != null">#{remark},</if>
  57. </trim>
  58. </insert>
  59. <update id="updateInvestigateTable" parameterType="InvestigateTable">
  60. update investigate_table
  61. <trim prefix="SET" suffixOverrides=",">
  62. <if test="investigateName != null">investigate_name = #{investigateName},</if>
  63. <if test="content != null">content = #{content},</if>
  64. <if test="endTime != null">end_time = #{endTime},</if>
  65. <if test="cipher != null">cipher = #{cipher},</if>
  66. <if test="createBy != null">create_by = #{createBy},</if>
  67. <if test="createTime != null">create_time = #{createTime},</if>
  68. <if test="updateBy != null">update_by = #{updateBy},</if>
  69. <if test="updateTime != null">update_time = #{updateTime},</if>
  70. <if test="remark != null">remark = #{remark},</if>
  71. </trim>
  72. where investigate_table_id = #{investigateTableId}
  73. </update>
  74. <delete id="deleteInvestigateTableById" parameterType="Long">
  75. delete from investigate_table where investigate_table_id = #{investigateTableId}
  76. </delete>
  77. <delete id="deleteInvestigateTableByIds" parameterType="String">
  78. delete from investigate_table where investigate_table_id in
  79. <foreach item="id" collection="array" open="(" separator="," close=")">
  80. #{id}
  81. </foreach>
  82. </delete>
  83. </mapper>