|
@@ -0,0 +1,573 @@
|
|
|
+<?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.ruoyi.yiqi.mapper.YqGOrderMapper">
|
|
|
+ <resultMap type="com.ruoyi.yiqi.entity.YqGOrder" id="GOrderResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="orderNum" column="order_num"/>
|
|
|
+ <result property="serviceType" column="service_type"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="houseId" column="house_id"/>
|
|
|
+ <result property="time" column="time"/>
|
|
|
+ <result property="pipeType" column="pipe_type"/>
|
|
|
+ <result property="pipeLength" column="pipe_length"/>
|
|
|
+ <result property="valveType" column="valve_type"/>
|
|
|
+ <result property="orderStatus" column="order_status"/>
|
|
|
+ <result property="examineStatus" column="examine_status"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="reason" column="reason"/>
|
|
|
+ <result property="version" column="version"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="getListAll" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select
|
|
|
+ if(CONCAT(
|
|
|
+ f.dict_label,
|
|
|
+ '-',
|
|
|
+ e.NAME,
|
|
|
+ '-',
|
|
|
+ d.NAME,
|
|
|
+ '-',
|
|
|
+ c.NAME,
|
|
|
+ '-',
|
|
|
+ b.NAME
|
|
|
+ ) is null,null,(select go.id from g_order go where go.house_id = a.house_id and go.del_flag='0' and go.service_type='004' order by go.time desc LIMIT 1)) as anjianId,
|
|
|
+ a.id as id,
|
|
|
+ a.service_type as serviceType,
|
|
|
+ u.name as userName,
|
|
|
+ a.pipe_type as pipeType,
|
|
|
+ a.pipe_length as pipeLength,
|
|
|
+ a.valve_type as valveType,
|
|
|
+ a.order_status as orderStatus,
|
|
|
+ a.examine_status as examineStatus,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.whether as whether,
|
|
|
+ a.version as version,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join sys_dict_data f on ( e.district = f.dict_value and f.dict_type='district')
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ where a.del_flag = '0'
|
|
|
+ and a.service_type not in ('004','005','006')
|
|
|
+
|
|
|
+ <if test="p.serviceType != null and p.serviceType != ''">
|
|
|
+ and a.service_type = #{p.serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.orderStatus != null and p.orderStatus != ''">
|
|
|
+ and a.order_status = #{p.orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.examineStatus != null and p.examineStatus != ''">
|
|
|
+ and a.examine_status = #{p.examineStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND SUBSTRING(u.job_num, 1,4) like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by time desc
|
|
|
+ </select>
|
|
|
+ <select id="getListExport" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select a.id as id,
|
|
|
+ a.service_type as serviceType,
|
|
|
+ u.name as userName,
|
|
|
+ a.pipe_type as pipeType,
|
|
|
+ a.pipe_length as pipeLength,
|
|
|
+ a.valve_type as valveType,
|
|
|
+ a.order_status as orderStatus,
|
|
|
+ a.examine_status as examineStatus,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as exportTime,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house,
|
|
|
+ a.whether as whether,
|
|
|
+ a.version as version,
|
|
|
+ a.house_id as houseId,
|
|
|
+ a.reason as reason
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ where a.del_flag = '0'
|
|
|
+ and a.service_type not in ('004','005','006')
|
|
|
+ and f.dict_type='district'
|
|
|
+ <if test="p.serviceType != null and p.serviceType != ''">
|
|
|
+ and a.service_type = #{p.serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.orderStatus != null and p.orderStatus != ''">
|
|
|
+ and a.order_status = #{p.orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.examineStatus != null and p.examineStatus != ''">
|
|
|
+ and a.examine_status = #{p.examineStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND SUBSTRING(u.job_num, 1,4) like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by time desc
|
|
|
+ </select>
|
|
|
+ <select id="getListExamine" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select a.id as id,
|
|
|
+ a.service_type as serviceType,
|
|
|
+ u.name as userName,
|
|
|
+ a.pipe_type as pipeType,
|
|
|
+ a.pipe_length as pipeLength,
|
|
|
+ a.valve_type as valveType,
|
|
|
+ a.order_status as orderStatus,
|
|
|
+ a.examine_status as examineStatus,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.whether as whether,
|
|
|
+ a.version as version,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join sys_dict_data f on ( e.district = f.dict_value and f.dict_type='district')
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ where a.del_flag = '0' and a.order_status = '001'
|
|
|
+ and a.service_type not in ('004','005','006')
|
|
|
+ <if test="p.serviceType != null and p.serviceType != ''">
|
|
|
+ and a.service_type = #{p.serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.orderStatus != null and p.orderStatus != ''">
|
|
|
+ and a.order_status = #{p.orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.examineStatus != null and p.examineStatus != ''">
|
|
|
+ and a.examine_status = #{p.examineStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND SUBSTRING(u.job_num, 1,4) like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by time desc
|
|
|
+ </select>
|
|
|
+ <select id="getById" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select * from g_order a
|
|
|
+ left join g_house b on a.house_id = b.id
|
|
|
+ left join g_unit c on b.unit_id = c.id
|
|
|
+ left join g_building d on c.building_id = d.id
|
|
|
+ where a.id = #{id} and a.del_flag = '0'
|
|
|
+ </select>
|
|
|
+ <select id="getByIdAndVersion" resultType="java.lang.Long">
|
|
|
+ select count(*) from g_order
|
|
|
+ where id = #{id} and del_flag = '0' and version = #{version}
|
|
|
+ </select>
|
|
|
+ <select id="getCount" resultType="java.lang.Integer">
|
|
|
+ select count(DISTINCT o.house_id)
|
|
|
+ from g_order o
|
|
|
+ left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
|
|
|
+ left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
|
|
|
+ where d.id = #{id}
|
|
|
+ and o.del_flag = '0'
|
|
|
+ and o.order_status = '002'
|
|
|
+ and o.service_type = '002'
|
|
|
+ </select>
|
|
|
+ <select id="getExaminePipeType" resultType="com.ruoyi.yiqi.entity.YqGCensusVo">
|
|
|
+ select count(DISTINCT o.id) as value,
|
|
|
+ o.pipe_type as name
|
|
|
+ from g_order o
|
|
|
+ left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
|
|
|
+ left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
|
|
|
+ where o.service_type = '002'
|
|
|
+ and o.del_flag = '0'
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and d.id = #{id}
|
|
|
+ </if>
|
|
|
+ group by o.pipe_type
|
|
|
+ </select>
|
|
|
+ <select id="getExaminePipeLength" resultType="com.ruoyi.yiqi.entity.YqGCensusVo">
|
|
|
+ select count(DISTINCT o.id) as value,
|
|
|
+ o.pipe_length as name
|
|
|
+ from g_order o
|
|
|
+ left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
|
|
|
+ left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
|
|
|
+ where
|
|
|
+ o.service_type = '002'
|
|
|
+ and o.del_flag = '0'
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and d.id = #{id}
|
|
|
+ </if>
|
|
|
+ group by o.pipe_length
|
|
|
+ </select>
|
|
|
+ <select id="getExamineValveType" resultType="com.ruoyi.yiqi.entity.YqGCensusVo">
|
|
|
+ select count(DISTINCT o.id) as value,
|
|
|
+ o.valve_type as name
|
|
|
+ from g_order o
|
|
|
+ left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
|
|
|
+ left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
|
|
|
+ where o.service_type = '002'
|
|
|
+ and o.del_flag = '0'
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and d.id = #{id}
|
|
|
+ </if>
|
|
|
+ group by o.valve_type
|
|
|
+ </select>
|
|
|
+ <select id="getOrderForStatus" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select * from g_order
|
|
|
+ where house_id= #{houseId}
|
|
|
+ and del_flag = '0'
|
|
|
+ and service_type ='002'
|
|
|
+ and
|
|
|
+ (( examine_status='001')
|
|
|
+ or (order_status = '001'))
|
|
|
+ <if test="id != null and id!= ''">
|
|
|
+ and id != #{id}
|
|
|
+ </if>
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+ <select id="getListByStatus" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select a.id as id,
|
|
|
+ a.service_type as serviceType,
|
|
|
+ u.name as userName,
|
|
|
+ a.pipe_type as pipeType,
|
|
|
+ a.pipe_length as pipeLength,
|
|
|
+ a.valve_type as valveType,
|
|
|
+ a.order_status as orderStatus,
|
|
|
+ a.examine_status as examineStatus,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.whether as whether,
|
|
|
+ a.version as version,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on a.house_id = b.id
|
|
|
+ left join g_unit c on b.unit_id = c.id
|
|
|
+ left join g_building d on c.building_id = d.id
|
|
|
+ left join g_area e on d.area_id = e.id
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value
|
|
|
+ where a.del_flag = '0'
|
|
|
+ and a.service_type not in ('004','005','006')
|
|
|
+ and f.dict_type='district'
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.workerId != null and p.workerId != ''">
|
|
|
+ and a.user_id = #{p.workerId}
|
|
|
+ </if>
|
|
|
+ <if test="p.value != null and p.value != ''">
|
|
|
+ and a.examine_status = #{p.value}
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by time desc
|
|
|
+ </select>
|
|
|
+ <select id="getListAnJian" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select a.id as id,
|
|
|
+ u.name as userName,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.update_time as updateTime,
|
|
|
+ a.whether as whether,
|
|
|
+ a.version as version,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ left join sys_dict_data f on ( e.district = f.dict_value and f.dict_type='district')
|
|
|
+ where a.del_flag = '0' and a.service_type ='004'
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND u.job_num like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by a.update_time desc
|
|
|
+ </select>
|
|
|
+ <select id="getListAnJianExport" resultType="com.ruoyi.yiqi.entity.YqGOrderExportVoAnJian">
|
|
|
+ select a.id as id,
|
|
|
+ u.name as userName,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.update_time as updateTime,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house,
|
|
|
+ a.whether as whether
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value
|
|
|
+ where a.del_flag = '0'
|
|
|
+ and a.service_type ='004'
|
|
|
+ and f.dict_type='district'
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND u.job_num like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by a.update_time desc,userName
|
|
|
+ </select>
|
|
|
+ <select id="getListWeiXiu" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select a.id as id,
|
|
|
+ u.name as userName,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.update_time as updateTime,
|
|
|
+ a.whether as whether,
|
|
|
+ a.version as version,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join sys_dict_data f on ( e.district = f.dict_value AND f.dict_type='district')
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ where a.service_type ='005' and a.del_flag = '0'
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND u.job_num like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by a.update_time desc
|
|
|
+ </select>
|
|
|
+ <select id="getListWeiXiuExport" resultType="com.ruoyi.yiqi.entity.YqGOrderExportVoWeiXiu">
|
|
|
+ select a.id as id,
|
|
|
+ u.name as userName,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.update_time as updateTime,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house,
|
|
|
+ a.whether as whether
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ where a.del_flag = '0'
|
|
|
+ and a.service_type ='005'
|
|
|
+ and f.dict_type='district'
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND u.job_num like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by a.update_time desc,userName
|
|
|
+ </select>
|
|
|
+ <select id="getListKaiShuan" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select a.id as id,
|
|
|
+ u.name as userName,
|
|
|
+ a.remark as remark,
|
|
|
+ a.time as time,
|
|
|
+ a.update_time as updateTime,
|
|
|
+ CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
|
+ from g_order a
|
|
|
+ left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
|
|
|
+ left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
|
|
|
+ left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
|
|
|
+ left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value
|
|
|
+ left join g_user u on a.user_id = u.id
|
|
|
+ where a.del_flag = '0'
|
|
|
+ and a.service_type ='006'
|
|
|
+ and f.dict_type='district'
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ and a.user_id = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.areaId != null and p.areaId != ''">
|
|
|
+ and e.id = #{p.areaId}
|
|
|
+ </if>
|
|
|
+ <if test="p.buildingId != null and p.buildingId != ''">
|
|
|
+ and d.id = #{p.buildingId}
|
|
|
+ </if>
|
|
|
+ <if test="p.unitId != null and p.unitId != ''">
|
|
|
+ and c.id = #{p.unitId}
|
|
|
+ </if>
|
|
|
+ <if test="p.houseId != null and p.houseId != ''">
|
|
|
+ and a.house_id = #{p.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="p.jobNum != null and p.jobNum != ''">
|
|
|
+ AND u.job_num like CONCAT(CONCAT(#{p.jobNum}), '%')
|
|
|
+ </if>
|
|
|
+ <if test=" p.starTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> DATE_FORMAT(#{p.starTime},'%Y-%m-%d 00:00:00')
|
|
|
+ </if>
|
|
|
+ <if test=" p.endTime != null">
|
|
|
+ and DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{p.endTime},'%Y-%m-%d 23:59:59')
|
|
|
+ </if>
|
|
|
+ <if test=" p.district != null">
|
|
|
+ and e.district = #{p.district}
|
|
|
+ </if>
|
|
|
+ order by a.update_time desc
|
|
|
+ </select>
|
|
|
+ <select id="getByHouseId" resultType="com.ruoyi.yiqi.entity.YqGOrder">
|
|
|
+ select * from g_order
|
|
|
+ where house_id = #{houseId}
|
|
|
+ and service_type = "002"
|
|
|
+ and del_flag = '0'
|
|
|
+ </select>
|
|
|
+ <update id="updateOrderByHouseId" parameterType="java.lang.Long">
|
|
|
+ update g_order set examine_status='001', order_status='002' where house_id=#{houseId} and service_type='002'
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateHouseId" parameterType="java.lang.Long">
|
|
|
+ update g_order set house_id=#{xhouseId} where house_id=#{yhouseId}
|
|
|
+ </update>
|
|
|
+</mapper>
|