|
@@ -0,0 +1,56 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
+<mapper namespace="cn.com.ty.lift.ud.userComplaint.mapper.UserComplaintMapper">
|
|
|
+
|
|
|
+ <select id="selectAllByCondition" resultType="cn.com.ty.lift.ud.userComplaint.controller.response.UserComplaintResponse">
|
|
|
+ select
|
|
|
+ complaint.id id,
|
|
|
+ complaint.category category,
|
|
|
+ complaint.user_id userId,
|
|
|
+ complaint.complained_user_id complainedUserId,
|
|
|
+ complaint.name name,
|
|
|
+ complaint.mobile mobile,
|
|
|
+ complaint.imgs imgs,
|
|
|
+ complaint.comment comment,
|
|
|
+ complaint.create_time createTime,
|
|
|
+ complaint.create_by createBy,
|
|
|
+ complaint.update_time updateTime,
|
|
|
+ complaint.update_by updateBy,
|
|
|
+ info1.name complaintName,
|
|
|
+ info2.name complainedName
|
|
|
+ from user_complaint complaint
|
|
|
+ left join user_info info1 on complaint.user_id = info1.user_id
|
|
|
+ left join user_info info2 on complaint.complained_user_id = info2.user_id
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name.length>0">
|
|
|
+ complaint.name like concat("%",#{name},"%")
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null and mobile.length>0">
|
|
|
+ and complaint.mobile like concat("%",#{mobile},"%")
|
|
|
+ </if>
|
|
|
+ <if test="category != null">
|
|
|
+ and complaint.category = #{category}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{pageIndex},#{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectAllCountByCondition" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from user_complaint complaint
|
|
|
+ left join user_info info1 on complaint.user_id = info1.user_id
|
|
|
+ left join user_info info2 on complaint.complained_user_id = info2.user_id
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name.length>0">
|
|
|
+ complaint.name like concat("%",#{name},"%")
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null and mobile.length>0">
|
|
|
+ and complaint.mobile like concat("%",#{mobile},"%")
|
|
|
+ </if>
|
|
|
+ <if test="category != null">
|
|
|
+ and complaint.category = #{category}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+</mapper>
|