GarOrderEvaluateMapper.xml
2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?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.trash.garbage.mapper.GarOrderEvaluateMapper">
<resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderEvaluate">
<id property="garEvaluateId" column="gar_evaluate_id" jdbcType="VARCHAR"/>
<result property="garEvaluateContent" column="gar_evaluate_content" jdbcType="VARCHAR"/>
<result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
<result property="garEvaluateScore" column="gar_evaluate_score" jdbcType="TINYINT"/>
<result property="garEvaluateTarget" column="gar_evaluate_target" jdbcType="TINYINT"/>
<result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
<result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
<result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
<result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
<result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
<result property="garCompanyId" column="gar_company_id" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
gar_evaluate_id
,gar_evaluate_content,gar_evaluate_score,
gar_update_by,gar_create_by,gar_update_time,
gar_create_time,gar_remark,gar_order_id,gar_company_id,gar_evaluate_target
</sql>
<select id="queryEvaluateByEnterpriseIds" resultType="com.trash.garbage.pojo.domain.GarOrderEvaluate">
select
<include refid="Base_Column_List"></include>
from gar_order_evaluate
where gar_evaluate_target = #{type}
and gar_create_time >= date_sub(curdate(), interval 1 month)
and gar_create_time <= DATE_FORMAT(NOW(),'%Y-%m-%d 23:59:59')
and gar_company_id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="countIdGroupByOrderId" resultType="com.trash.garbage.pojo.domain.GarOrderEvaluate">
select count(gar_order_id) countTheNumber,gar_order_id from gar_order_evaluate WHERE
gar_order_id IN
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
AND gar_evaluate_target = #{type} GROUP BY gar_order_id
</select>
</mapper>