TUInspectionMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.business.slfh.manager.inspectionmanager.mapper.TUInspectionMapper">
  6. <resultMap type="TUInspection" id="TUInspectionResult">
  7. <result property="id" column="id" />
  8. <result property="status" column="status" />
  9. <result property="remark" column="remark" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="inspectionType" column="inspection_type" />
  16. <result property="recordTime" column="record_time" />
  17. <result property="longitude" column="longitude" />
  18. <result property="latitude" column="latitude" />
  19. <result property="userId" column="user_id" />
  20. <result property="userName" column="user_name" />
  21. </resultMap>
  22. <sql id="selectTUInspectionVo">
  23. select id, status, remark, del_flag, create_by, create_time, update_by, update_time, inspection_type, record_time, longitude, latitude, user_id, user_name from t_u_inspection
  24. </sql>
  25. <select id="selectTUInspectionList" parameterType="TUInspection" resultMap="TUInspectionResult">
  26. <include refid="selectTUInspectionVo"/>
  27. <where>
  28. <if test="status != null and status != ''"> and status = #{status}</if>
  29. <if test="inspectionType != null and inspectionType != ''"> and inspection_type = #{inspectionType}</if>
  30. <if test="recordTime != null "> and record_time = #{recordTime}</if>
  31. <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
  32. <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
  33. <if test="userId != null "> and user_id = #{userId}</if>
  34. <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
  35. </where>
  36. </select>
  37. <select id="selectTUInspectionById" parameterType="String" resultMap="TUInspectionResult">
  38. <include refid="selectTUInspectionVo"/>
  39. where id = #{id}
  40. </select>
  41. <insert id="insertTUInspection" parameterType="TUInspection">
  42. insert into t_u_inspection
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="id != null">id,</if>
  45. <if test="status != null">status,</if>
  46. <if test="remark != null">remark,</if>
  47. <if test="delFlag != null">del_flag,</if>
  48. <if test="createBy != null">create_by,</if>
  49. <if test="createTime != null">create_time,</if>
  50. <if test="updateBy != null">update_by,</if>
  51. <if test="updateTime != null">update_time,</if>
  52. <if test="inspectionType != null">inspection_type,</if>
  53. <if test="recordTime != null">record_time,</if>
  54. <if test="longitude != null">longitude,</if>
  55. <if test="latitude != null">latitude,</if>
  56. <if test="userId != null">user_id,</if>
  57. <if test="userName != null">user_name,</if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="id != null">#{id},</if>
  61. <if test="status != null">#{status},</if>
  62. <if test="remark != null">#{remark},</if>
  63. <if test="delFlag != null">#{delFlag},</if>
  64. <if test="createBy != null">#{createBy},</if>
  65. <if test="createTime != null">#{createTime},</if>
  66. <if test="updateBy != null">#{updateBy},</if>
  67. <if test="updateTime != null">#{updateTime},</if>
  68. <if test="inspectionType != null">#{inspectionType},</if>
  69. <if test="recordTime != null">#{recordTime},</if>
  70. <if test="longitude != null">#{longitude},</if>
  71. <if test="latitude != null">#{latitude},</if>
  72. <if test="userId != null">#{userId},</if>
  73. <if test="userName != null">#{userName},</if>
  74. </trim>
  75. </insert>
  76. <update id="updateTUInspection" parameterType="TUInspection">
  77. update t_u_inspection
  78. <trim prefix="SET" suffixOverrides=",">
  79. <if test="status != null">status = #{status},</if>
  80. <if test="remark != null">remark = #{remark},</if>
  81. <if test="delFlag != null">del_flag = #{delFlag},</if>
  82. <if test="createBy != null">create_by = #{createBy},</if>
  83. <if test="createTime != null">create_time = #{createTime},</if>
  84. <if test="updateBy != null">update_by = #{updateBy},</if>
  85. <if test="updateTime != null">update_time = #{updateTime},</if>
  86. <if test="inspectionType != null">inspection_type = #{inspectionType},</if>
  87. <if test="recordTime != null">record_time = #{recordTime},</if>
  88. <if test="longitude != null">longitude = #{longitude},</if>
  89. <if test="latitude != null">latitude = #{latitude},</if>
  90. <if test="userId != null">user_id = #{userId},</if>
  91. <if test="userName != null">user_name = #{userName},</if>
  92. </trim>
  93. where id = #{id}
  94. </update>
  95. <delete id="deleteTUInspectionById" parameterType="String">
  96. delete from t_u_inspection where id = #{id}
  97. </delete>
  98. <delete id="deleteTUInspectionByIds" parameterType="String">
  99. delete from t_u_inspection where id in
  100. <foreach item="id" collection="array" open="(" separator="," close=")">
  101. #{id}
  102. </foreach>
  103. </delete>
  104. </mapper>