SopUserLogsWxMapper.xml 4.4 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.fs.sop.mapper.SopUserLogsWxMapper">
  6. <resultMap type="SopUserLogsWx" id="SopUserLogsWxResult">
  7. <result property="id" column="id" />
  8. <result property="sopId" column="sop_id" />
  9. <result property="sopTempId" column="sop_temp_id" />
  10. <result property="userWxName" column="user_wx_name" />
  11. <result property="accountId" column="account_id" />
  12. <result property="companyUserId" column="company_user_id" />
  13. <result property="companyId" column="company_id" />
  14. <result property="startTime" column="start_time" />
  15. <result property="status" column="status" />
  16. </resultMap>
  17. <sql id="selectSopUserLogsWxVo">
  18. select id, sop_id, sop_temp_id, user_wx_name, account_id, company_user_id, company_id, start_time, status from sop_user_logs_wx
  19. </sql>
  20. <select id="selectSopUserLogsWxList" parameterType="SopUserLogsWx" resultMap="SopUserLogsWxResult">
  21. <include refid="selectSopUserLogsWxVo"/>
  22. <where>
  23. <if test="sopId != null and sopId != ''"> and sop_id = #{sopId}</if>
  24. <if test="sopTempId != null and sopTempId != ''"> and sop_temp_id = #{sopTempId}</if>
  25. <if test="userWxName != null and userWxName != ''"> and user_wx_name = #{userWxName}</if>
  26. <if test="accountId != null "> and account_id = #{accountId}</if>
  27. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  28. <if test="companyId != null "> and company_id = #{companyId}</if>
  29. <if test="startTime != null "> and start_time = #{startTime}</if>
  30. <if test="status != null "> and status = #{status}</if>
  31. </where>
  32. </select>
  33. <select id="selectSopUserLogsWxById" parameterType="Long" resultMap="SopUserLogsWxResult">
  34. <include refid="selectSopUserLogsWxVo"/>
  35. where id = #{id}
  36. </select>
  37. <insert id="insertSopUserLogsWx" parameterType="SopUserLogsWx" useGeneratedKeys="true" keyProperty="id">
  38. insert into sop_user_logs_wx
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="sopId != null">sop_id,</if>
  41. <if test="sopTempId != null">sop_temp_id,</if>
  42. <if test="userWxName != null">user_wx_name,</if>
  43. <if test="accountId != null">account_id,</if>
  44. <if test="companyUserId != null">company_user_id,</if>
  45. <if test="companyId != null">company_id,</if>
  46. <if test="startTime != null">start_time,</if>
  47. <if test="status != null">status,</if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides=",">
  50. <if test="sopId != null">#{sopId},</if>
  51. <if test="sopTempId != null">#{sopTempId},</if>
  52. <if test="userWxName != null">#{userWxName},</if>
  53. <if test="accountId != null">#{accountId},</if>
  54. <if test="companyUserId != null">#{companyUserId},</if>
  55. <if test="companyId != null">#{companyId},</if>
  56. <if test="startTime != null">#{startTime},</if>
  57. <if test="status != null">#{status},</if>
  58. </trim>
  59. </insert>
  60. <update id="updateSopUserLogsWx" parameterType="SopUserLogsWx">
  61. update sop_user_logs_wx
  62. <trim prefix="SET" suffixOverrides=",">
  63. <if test="sopId != null">sop_id = #{sopId},</if>
  64. <if test="sopTempId != null">sop_temp_id = #{sopTempId},</if>
  65. <if test="userWxName != null">user_wx_name = #{userWxName},</if>
  66. <if test="accountId != null">account_id = #{accountId},</if>
  67. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  68. <if test="companyId != null">company_id = #{companyId},</if>
  69. <if test="startTime != null">start_time = #{startTime},</if>
  70. <if test="status != null">status = #{status},</if>
  71. </trim>
  72. where id = #{id}
  73. </update>
  74. <delete id="deleteSopUserLogsWxById" parameterType="Long">
  75. delete from sop_user_logs_wx where id = #{id}
  76. </delete>
  77. <delete id="deleteSopUserLogsWxByIds" parameterType="String">
  78. delete from sop_user_logs_wx where id in
  79. <foreach item="id" collection="array" open="(" separator="," close=")">
  80. #{id}
  81. </foreach>
  82. </delete>
  83. </mapper>