FsStatisTempParamMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.statis.mapper.FsStatisTempParamMapper">
  6. <!-- Enable auto-mapping from snake_case DB columns to camelCase DTO fields -->
  7. <!-- This is often configured globally in mybatis-config.xml or Spring Boot properties -->
  8. <!-- <settings>
  9. <setting name="mapUnderscoreToCamelCase" value="true"/>
  10. </settings> -->
  11. <resultMap id="BaseResultMap" type="com.fs.statis.domain.FsStatisTempParam">
  12. <id column="id" property="id" jdbcType="INTEGER"/>
  13. <result column="company_user_id" property="companyUserId" jdbcType="BIGINT"/>
  14. <result column="sop_id" property="sopId" jdbcType="BIGINT"/>
  15. <result column="this_date" property="thisDate" jdbcType="VARCHAR"/>
  16. <result column="qw_user_id" property="qwUserId" jdbcType="BIGINT"/>
  17. <result column="period_id" property="periodId" jdbcType="VARCHAR"/>
  18. <result column="start_time" property="startTime" jdbcType="VARCHAR"/>
  19. <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <!-- or DATETIME -->
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. id, company_user_id, sop_id, this_date, qw_user_id, period_id, start_time, create_time
  23. </sql>
  24. <select id="selectById" resultMap="BaseResultMap">
  25. SELECT <include refid="Base_Column_List" />
  26. FROM fs_statis_temp_param
  27. WHERE id = #{id,jdbcType=INTEGER}
  28. </select>
  29. <select id="selectAll" resultMap="BaseResultMap">
  30. SELECT <include refid="Base_Column_List" />
  31. FROM fs_statis_temp_param
  32. </select>
  33. <delete id="deleteById">
  34. DELETE FROM fs_statis_temp_param
  35. WHERE id = #{id,jdbcType=INTEGER}
  36. </delete>
  37. <insert id="insert" parameterType="com.fs.statis.domain.FsStatisTempParam" useGeneratedKeys="true" keyProperty="id">
  38. INSERT INTO fs_statis_temp_param (company_user_id, sop_id, this_date,
  39. qw_user_id, period_id, start_time, create_time)
  40. VALUES (#{companyUserId,jdbcType=BIGINT}, #{sopId,jdbcType=BIGINT}, #{thisDate,jdbcType=VARCHAR},
  41. #{qwUserId,jdbcType=BIGINT}, #{periodId,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR},
  42. #{createTime,jdbcType=TIMESTAMP})
  43. </insert>
  44. <insert id="insertSelective" parameterType="com.fs.statis.domain.FsStatisTempParam" useGeneratedKeys="true" keyProperty="id">
  45. INSERT INTO fs_statis_temp_param
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="companyUserId != null">company_user_id,</if>
  48. <if test="sopId != null">sop_id,</if>
  49. <if test="thisDate != null">this_date,</if>
  50. <if test="qwUserId != null">qw_user_id,</if>
  51. <if test="periodId != null">period_id,</if>
  52. <if test="startTime != null">start_time,</if>
  53. <if test="createTime != null">create_time,</if>
  54. </trim>
  55. <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
  56. <if test="companyUserId != null">#{companyUserId,jdbcType=BIGINT},</if>
  57. <if test="sopId != null">#{sopId,jdbcType=BIGINT},</if>
  58. <if test="thisDate != null">#{thisDate,jdbcType=VARCHAR},</if>
  59. <if test="qwUserId != null">#{qwUserId,jdbcType=BIGINT},</if>
  60. <if test="periodId != null">#{periodId,jdbcType=VARCHAR},</if>
  61. <if test="startTime != null">#{startTime,jdbcType=VARCHAR},</if>
  62. <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
  63. </trim>
  64. </insert>
  65. <insert id="batchSave">
  66. REPLACE INTO fs_statis_temp_param (
  67. company_user_id, sop_id, this_date, qw_user_id,
  68. period_id, start_time, create_time,dept_id
  69. )
  70. VALUES
  71. <foreach collection="list" item="item" separator=",">
  72. (
  73. #{item.companyUserId}, #{item.sopId}, #{item.thisDate}, #{item.qwUserId},
  74. #{item.periodId}, #{item.startTime}, #{item.createTime},#{item.deptId}
  75. )
  76. </foreach>
  77. </insert>
  78. <insert id="batchSaveToSop">
  79. REPLACE INTO fs_statis_temp_param (
  80. company_user_id, sop_id, this_date, qw_user_id,
  81. period_id, start_time, create_time,dept_id
  82. )
  83. VALUES
  84. <foreach collection="list" item="item" separator=",">
  85. (
  86. #{item.companyUserId}, #{item.sopId}, #{item.thisDate}, #{item.qwUserId},
  87. #{item.periodId}, #{item.startTime}, #{item.createTime},#{item.deptId}
  88. )
  89. </foreach>
  90. </insert>
  91. <update id="updateById" parameterType="com.fs.statis.domain.FsStatisTempParam">
  92. UPDATE fs_statis_temp_param
  93. SET
  94. company_user_id = #{companyUserId,jdbcType=BIGINT},
  95. sop_id = #{sopId,jdbcType=BIGINT},
  96. this_date = #{thisDate,jdbcType=VARCHAR},
  97. qw_user_id = #{qwUserId,jdbcType=BIGINT},
  98. period_id = #{periodId,jdbcType=VARCHAR},
  99. start_time = #{startTime,jdbcType=VARCHAR},
  100. create_time = #{createTime,jdbcType=TIMESTAMP}
  101. WHERE id = #{id,jdbcType=INTEGER}
  102. </update>
  103. <update id="updateByIdSelective" parameterType="com.fs.statis.domain.FsStatisTempParam">
  104. UPDATE fs_statis_temp_param
  105. <set>
  106. <if test="companyUserId != null">company_user_id = #{companyUserId,jdbcType=BIGINT},</if>
  107. <if test="sopId != null">sop_id = #{sopId,jdbcType=BIGINT},</if>
  108. <if test="thisDate != null">this_date = #{thisDate,jdbcType=VARCHAR},</if>
  109. <if test="qwUserId != null">qw_user_id = #{qwUserId,jdbcType=BIGINT},</if>
  110. <if test="periodId != null">period_id = #{periodId,jdbcType=VARCHAR},</if>
  111. <if test="startTime != null">start_time = #{startTime,jdbcType=VARCHAR},</if>
  112. <if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
  113. </set>
  114. WHERE id = #{id,jdbcType=INTEGER}
  115. </update>
  116. </mapper>