<?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="com.stylefeng.guns.modular.system.dao.ComplaintDeductmoneyMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.ComplaintDeductmoney">
|
<id column="id" property="id" />
|
<result column="createTime" property="createTime" />
|
<result column="driverId" property="driverId" />
|
<result column="money" property="money" />
|
<result column="reason" property="reason" />
|
<result column="complaintIds" property="complaintIds" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, createTime, driverId, money, reason, complaintIds
|
</sql>
|
<select id="getList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
|
SELECT c.*,d.phone,d.`name` FROM t_complaint_deductmoney c LEFT JOIN t_driver d ON c.driverId=d.id
|
<where>
|
1=1 and d.companyId=#{companyId}
|
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
AND (c.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
|
</if>
|
<if test="userId != null and userId != ''">
|
and find_in_set(driverId, #{userId})
|
</if>
|
<if test="phone != null and phone != ''">
|
and d.phone LIKE CONCAT('%',#{phone},'%')
|
</if>
|
<if test="name != null and name != ''">
|
and d.name LIKE CONCAT('%',#{name},'%')
|
</if>
|
<if test="id != null and id != ''">
|
and c.id LIKE CONCAT('%',#{id},'%')
|
</if>
|
</where>
|
</select>
|
<select id="getListEx" resultType="map">
|
SELECT c.*,d.phone,d.`name` FROM t_complaint_deductmoney c LEFT JOIN t_driver d ON c.driverId=d.id
|
<where>
|
1=1 and d.companyId=#{companyId}
|
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
AND (c.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
|
</if>
|
<if test="userId != null and userId != ''">
|
and find_in_set(driverId, #{userId})
|
</if>
|
<if test="phone != null and phone != ''">
|
and d.phone LIKE CONCAT('%',#{phone},'%')
|
</if>
|
<if test="name != null and name != ''">
|
and d.name LIKE CONCAT('%',#{name},'%')
|
</if>
|
<if test="id != null and id != ''">
|
and c.id LIKE CONCAT('%',#{id},'%')
|
</if>
|
</where>
|
</select>
|
<select id="getSumMoney" resultType="java.lang.Double">
|
SELECT SUM(money) FROM t_complaint_deductmoney c LEFT JOIN t_driver d ON c.driverId=d.id
|
<where>
|
1=1 and d.companyId=#{companyId}
|
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
AND (c.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
|
</if>
|
<if test="userId != null and userId != ''">
|
and find_in_set(driverId, #{userId})
|
</if>
|
<if test="phone != null and phone != ''">
|
and d.phone LIKE CONCAT('%',#{phone},'%')
|
</if>
|
<if test="name != null and name != ''">
|
and d.name LIKE CONCAT('%',#{name},'%')
|
</if>
|
<if test="id != null and id != ''">
|
and c.id LIKE CONCAT('%',#{id},'%')
|
</if>
|
</where>
|
</select>
|
</mapper>
|