|
@@ -0,0 +1,710 @@
|
|
|
+<?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.platform.dao.mapper.sb.SbInfoMeasureMapper">
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id
|
|
|
+ , no,
|
|
|
+financing_no,
|
|
|
+financing_no_two,
|
|
|
+financing_no_third,
|
|
|
+financing_no_four,
|
|
|
+financing_no_five,
|
|
|
+param_list,
|
|
|
+name, model_id,
|
|
|
+ is_child,
|
|
|
+ is_show,
|
|
|
+ is_financing,
|
|
|
+ type_id, level, initial_value, current_value, cut_value,
|
|
|
+ producer_id, source_type, source_sb_id, parent_id, unit, position_id,
|
|
|
+ use_area,
|
|
|
+ check_id,
|
|
|
+ rate,
|
|
|
+ month,
|
|
|
+ used_month,
|
|
|
+ card_no,
|
|
|
+ use_company,
|
|
|
+ use_project,
|
|
|
+ use_dept,
|
|
|
+ use_group,
|
|
|
+ use_user,
|
|
|
+ save_dept,
|
|
|
+ save_user,
|
|
|
+ repair_user,
|
|
|
+ buy_date, start_date, next_check_date, guarantee_date, work_year, retirement_date,
|
|
|
+ depreciation_type, wb_file, use_file, check_file, sb_image, qr_code, status, remark,
|
|
|
+ created_user_id, update_user_id, created_time, update_time,
|
|
|
+ zzh,
|
|
|
+ fdjxh,
|
|
|
+ fdjh,
|
|
|
+ cph,
|
|
|
+ dph,
|
|
|
+ zz,
|
|
|
+ zaiz,
|
|
|
+ last_repaire_time,
|
|
|
+ repaire_times,
|
|
|
+ last_baoyang_time,
|
|
|
+ last_baoyang_hours,
|
|
|
+ last_baoyang_miles,
|
|
|
+ baoyang_times,
|
|
|
+ rl_type,
|
|
|
+ color,
|
|
|
+ use_type,
|
|
|
+ seat_number,
|
|
|
+ zjm,
|
|
|
+ sp_date,
|
|
|
+ jbdh,
|
|
|
+ sbdh,
|
|
|
+ jbd_date,
|
|
|
+ sbd_date,
|
|
|
+ bxgs,
|
|
|
+ sb_date,
|
|
|
+ check_date,
|
|
|
+ check_period,
|
|
|
+ register_no,
|
|
|
+ character_type,
|
|
|
+ used_no,
|
|
|
+ supplier,
|
|
|
+ repair_user_second,
|
|
|
+ batch_no,
|
|
|
+ register_date,
|
|
|
+zbh,
|
|
|
+refuse_reason,
|
|
|
+apply_time,
|
|
|
+ audit_time,
|
|
|
+ submit_time,
|
|
|
+ process_instance_id,
|
|
|
+ audit_node,
|
|
|
+ remark,
|
|
|
+ apply_comment,
|
|
|
+scrap_user_id,
|
|
|
+scrap_user_name
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="Left_Column">
|
|
|
+ sb
|
|
|
+ .
|
|
|
+ id
|
|
|
+ , sb.no,
|
|
|
+sb.financing_no_two,
|
|
|
+sb.financing_no_third,
|
|
|
+sb.financing_no_four,
|
|
|
+sb.financing_no_five,
|
|
|
+sb.financing_no,
|
|
|
+sb.name, sb.initial_value,
|
|
|
+ sb.current_value, sb.cut_value,
|
|
|
+ sb.is_child,
|
|
|
+ sb.is_financing,
|
|
|
+ sb.parent_id,
|
|
|
+sb.param_list,
|
|
|
+ sb.is_show,
|
|
|
+ sb.unit, sb.position_id,
|
|
|
+ sb.use_area,
|
|
|
+ sb.rate,
|
|
|
+ sb.month,
|
|
|
+ sb.used_month,
|
|
|
+ sb.card_no,
|
|
|
+ sb.check_id,
|
|
|
+ sb.use_company,
|
|
|
+ sb.use_project,
|
|
|
+ sb.use_dept,
|
|
|
+ sb.use_group,
|
|
|
+ sb.use_user,
|
|
|
+ sb.save_dept,
|
|
|
+ sb.save_user,
|
|
|
+ sb.repair_user,
|
|
|
+ sb.buy_date, sb.start_date, sb.next_check_date, sb.guarantee_date, sb.work_year,
|
|
|
+ sb.retirement_date,
|
|
|
+ sb.depreciation_type, sb.wb_file, sb.use_file, sb.check_file, sb.sb_image, sb.qr_code, sb.status, sb.remark,
|
|
|
+ sb.created_user_id, sb.update_user_id, sb.created_time, sb.update_time,
|
|
|
+ sb.model_id,
|
|
|
+ sb.zzh,
|
|
|
+ sb.fdjxh,
|
|
|
+ sb.fdjh,
|
|
|
+ sb.cph,
|
|
|
+ sb.dph,
|
|
|
+ sb.zz,
|
|
|
+ sb.zaiz,
|
|
|
+ sb.last_repaire_time,
|
|
|
+ sb.repaire_times,
|
|
|
+ sb.last_baoyang_time,
|
|
|
+ sb.last_baoyang_hours,
|
|
|
+ sb.last_baoyang_miles,
|
|
|
+ sb.use_type,
|
|
|
+ sb.baoyang_times,
|
|
|
+ sb.rl_type,
|
|
|
+ sb.color,
|
|
|
+ sb.seat_number,
|
|
|
+ sb.zjm,
|
|
|
+ sb.sp_date,
|
|
|
+ sb.jbdh,
|
|
|
+ sb.sbdh,
|
|
|
+ sb.total_hours,
|
|
|
+ sb.total_miles,
|
|
|
+ sb.jbd_date,
|
|
|
+ sb.sbd_date,
|
|
|
+ sb.bxgs,
|
|
|
+ sb.sb_date,
|
|
|
+ sb.type_id as typeId,
|
|
|
+ sb.name_model as nameModel,
|
|
|
+ sb.model,
|
|
|
+ sb.producer_id as producerId,
|
|
|
+ sb.level,
|
|
|
+ sb.unit,
|
|
|
+ sb.use_type as useType,
|
|
|
+ sbType.name as typeName,producer.name as producerName,
|
|
|
+ position.name as positionName,
|
|
|
+ sb.check_date,
|
|
|
+ sb.check_period,
|
|
|
+ sb.register_no,
|
|
|
+ sb.character_type,
|
|
|
+ sb.used_no,
|
|
|
+sb.zbh,
|
|
|
+ sb.supplier,
|
|
|
+ sb.repair_user_second,
|
|
|
+ sb.batch_no,
|
|
|
+ sb.register_date,
|
|
|
+sb.refuse_reason,
|
|
|
+sb.apply_time,
|
|
|
+ sb.audit_time,
|
|
|
+ sb.submit_time,
|
|
|
+ sb.process_instance_id,
|
|
|
+ sb.audit_node,
|
|
|
+ sb.remark,
|
|
|
+ sb.apply_comment,
|
|
|
+sb.scrap_user_id,
|
|
|
+sb.scrap_user_name,
|
|
|
+user.real_name as saveUserName
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="deptSql">
|
|
|
+ <if test="saveDept != null and saveDept != ''">
|
|
|
+ and sb.save_dept = #{saveDept}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectVOList" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
|
|
|
+ resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
|
|
|
+ select
|
|
|
+ <include refid="Left_Column"/>
|
|
|
+ from t_sb_info_measure sb
|
|
|
+ left join t_sb_type sbType on sb.type_id = sbType.id
|
|
|
+ left join t_firm_producer producer on sb.producer_id = producer.id
|
|
|
+ left join t_sb_position position on sb.position_id = position.id
|
|
|
+ left join t_sys_user user on sb.save_user = user.user_id
|
|
|
+ left join t_sys_dept sdDept on sb.save_dept = sdDept.dept_id
|
|
|
+ where
|
|
|
+ 1 = 1
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and sb.name like concat('%',#{keyword},'%')
|
|
|
+ </if>
|
|
|
+ <if test="cardNo != null and cardNo!=''">
|
|
|
+ and sb.cardNo like concat('%',#{cardNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="no != null and no!=''">
|
|
|
+ and sb.no like concat('%',#{no},'%')
|
|
|
+ </if>
|
|
|
+ <if test="zbh != null and zbh!=''">
|
|
|
+ and sb.zbh like concat('%',#{zbh},'%')
|
|
|
+ </if>
|
|
|
+ <if test="likeDeptCode != null and likeDeptCode!=''">
|
|
|
+ and sdDept.dept_code like concat(#{likeDeptCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="financingNo != null and financingNo!=''">
|
|
|
+ and sb.financing_no like concat(#{financingNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="positionIds != null">
|
|
|
+ AND sb.position_id in
|
|
|
+ <foreach item="item" index="index" collection="positionIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="useType != null">
|
|
|
+ and sb.use_type = #{useType}
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ and sb.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null">
|
|
|
+ and sb.check_id = #{checkId}
|
|
|
+ </if>
|
|
|
+ <if test="isChild != null">
|
|
|
+ and sb.is_child = #{isChild}
|
|
|
+ </if>
|
|
|
+ <if test="isShow != null">
|
|
|
+ and sb.is_show = #{isShow}
|
|
|
+ </if>
|
|
|
+ <if test="isFinancing != null">
|
|
|
+ and sb.is_financing = #{isFinancing}
|
|
|
+ </if>
|
|
|
+ <if test="useArea != null">
|
|
|
+ and sb.use_area = #{useArea}
|
|
|
+ </if>
|
|
|
+ <if test="useCompany != null">
|
|
|
+ and sb.use_company = #{useCompany}
|
|
|
+ </if>
|
|
|
+ <if test="useProject != null">
|
|
|
+ and sb.use_project = #{useProject}
|
|
|
+ </if>
|
|
|
+ <if test="typeId != null">
|
|
|
+ and sb.type_id = #{typeId}
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null">
|
|
|
+ and sb.parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="model != null">
|
|
|
+ and sb.model like concat('%',#{model},'%')
|
|
|
+ </if>
|
|
|
+ <if test="useDept != null">
|
|
|
+ and sb.use_dept = #{useDept}
|
|
|
+ </if>
|
|
|
+ <if test="useGroup != null">
|
|
|
+ and sb.use_group = #{useGroup}
|
|
|
+ </if>
|
|
|
+ <if test="saveDept != null">
|
|
|
+ and sb.save_dept = #{saveDept}
|
|
|
+ </if>
|
|
|
+ <if test="saveUser != null">
|
|
|
+ and sb.save_user = #{saveUser}
|
|
|
+ </if>
|
|
|
+ <if test="nextCheckDateStart != null">
|
|
|
+ and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
|
|
|
+ </if>
|
|
|
+ <if test="nextCheckDateEnd != null">
|
|
|
+ and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
|
|
|
+ </if>
|
|
|
+ <if test="repairUser != null">
|
|
|
+ and sb.repair_user = #{repairUser}
|
|
|
+ </if>
|
|
|
+ <if test="repairUserSecond != null">
|
|
|
+ and sb.repair_user_second = #{repairUserSecond}
|
|
|
+ </if>
|
|
|
+ <if test="repairUserSearch != null">
|
|
|
+ and (
|
|
|
+ sb.repair_user = #{repairUserSearch}
|
|
|
+ or
|
|
|
+ sb.repair_user_second = #{repairUserSearch}
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and sb.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="modelId != null">
|
|
|
+ and sb.model_id = #{modelId}
|
|
|
+ </if>
|
|
|
+ <if test="notStatusList != null and notStatusList.size > 0">
|
|
|
+ AND sb.status not in
|
|
|
+ <foreach item="item" index="index" collection="notStatusList" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="statusList != null and statusList.size > 0">
|
|
|
+ AND sb.status in
|
|
|
+ <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sbIds != null and sbIds.size > 0">
|
|
|
+ AND sb.id in
|
|
|
+ <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="ascriptionDept != null and ascriptionDept">
|
|
|
+ <include refid="deptSql"/>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectVOListStandard" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
|
|
|
+ resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
|
|
|
+ SELECT
|
|
|
+ sb.id,
|
|
|
+ sb.no,
|
|
|
+ sbType.name as typeName,
|
|
|
+ sb.NAME,
|
|
|
+ sb.zbh,
|
|
|
+ sb.status,
|
|
|
+ sb.use_type,
|
|
|
+ sb.type_id,
|
|
|
+ count( standard.id ) as standardNum
|
|
|
+ FROM
|
|
|
+ t_sb_info_measure sb
|
|
|
+ LEFT JOIN t_check_standard standard ON sb.id = standard.sb_id
|
|
|
+ left join t_sb_type sbType on sb.type_id = sbType.id
|
|
|
+ where
|
|
|
+ 1 = 1
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (
|
|
|
+ sb.name like concat('%',#{keyword},'%')
|
|
|
+ or
|
|
|
+ sb.no like concat('%',#{keyword},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="zbh != null and zbh!=''">
|
|
|
+ and sb.zbh like concat('%',#{zbh},'%')
|
|
|
+ </if>
|
|
|
+ <if test="useType != null">
|
|
|
+ and sb.use_type = #{useType}
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ and sb.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null">
|
|
|
+ and sb.check_id = #{checkId}
|
|
|
+ </if>
|
|
|
+ <if test="isChild != null">
|
|
|
+ and sb.is_child = #{isChild}
|
|
|
+ </if>
|
|
|
+ <if test="isFinancing != null">
|
|
|
+ and sb.is_financing = #{isFinancing}
|
|
|
+ </if>
|
|
|
+ <if test="isShow != null">
|
|
|
+ and sb.is_show = #{isShow}
|
|
|
+ </if>
|
|
|
+ <if test="useArea != null">
|
|
|
+ and sb.use_area = #{useArea}
|
|
|
+ </if>
|
|
|
+ <if test="useCompany != null">
|
|
|
+ and sb.use_company = #{useCompany}
|
|
|
+ </if>
|
|
|
+ <if test="useProject != null">
|
|
|
+ and sb.use_project = #{useProject}
|
|
|
+ </if>
|
|
|
+ <if test="typeId != null">
|
|
|
+ and sb.type_id = #{typeId}
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null">
|
|
|
+ and sb.parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="model != null">
|
|
|
+ and sb.model like concat('%',#{model},'%')
|
|
|
+ </if>
|
|
|
+ <if test="useDept != null">
|
|
|
+ and sb.use_dept = #{useDept}
|
|
|
+ </if>
|
|
|
+ <if test="useGroup != null">
|
|
|
+ and sb.use_group = #{useGroup}
|
|
|
+ </if>
|
|
|
+ <if test="saveDept != null">
|
|
|
+ and sb.save_dept = #{saveDept}
|
|
|
+ </if>
|
|
|
+ <if test="saveUser != null">
|
|
|
+ and sb.save_user = #{saveUser}
|
|
|
+ </if>
|
|
|
+ <if test="nextCheckDateStart != null">
|
|
|
+ and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
|
|
|
+ </if>
|
|
|
+ <if test="nextCheckDateEnd != null">
|
|
|
+ and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and sb.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="modelId != null">
|
|
|
+ and sb.model_id = #{modelId}
|
|
|
+ </if>
|
|
|
+ group by sb.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectScreenDetailVOList"
|
|
|
+ parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
|
|
|
+ resultType="com.platform.dao.vo.sb.SbInfoScreenDetailVO">
|
|
|
+ select
|
|
|
+ sb.id, sb.no, sb.zjm, sb.jbdh, sb.level
|
|
|
+ from t_sb_info_measure sb
|
|
|
+ <where>
|
|
|
+ sb.zjm is not null
|
|
|
+ and sb.jbdh is not null
|
|
|
+ and is_show = true
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectPageInfoForWarn" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO"
|
|
|
+ resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
|
|
|
+ select
|
|
|
+ <include refid="Left_Column"/>
|
|
|
+ from t_sb_info_measure sb
|
|
|
+ left join t_sb_type sbType on sb.type_id = sbType.id
|
|
|
+ left join t_firm_producer producer on sb.producer_id = producer.id
|
|
|
+ left join t_sb_position position on sb.position_id = position.id
|
|
|
+ left join t_sys_user user on sb.save_user = user.user_id
|
|
|
+ left join t_sys_dept sdDept on sb.save_dept = sdDept.dept_id
|
|
|
+ where
|
|
|
+ TIMESTAMPDIFF( DAY, CURDATE( ), sb.next_check_date ) <![CDATA[ <= ]]> sb.seat_number
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and (
|
|
|
+ sb.name like concat('%',#{keyword},'%')
|
|
|
+ or
|
|
|
+ sb.no like concat('%',#{keyword},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="likeDeptCode != null and likeDeptCode!=''">
|
|
|
+ and sdDept.dept_code like concat(#{likeDeptCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="financingNo != null and financingNo!=''">
|
|
|
+ and sb.financing_no like concat(#{financingNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="positionIds != null">
|
|
|
+ AND sb.position_id in
|
|
|
+ <foreach item="item" index="index" collection="positionIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="useType != null">
|
|
|
+ and sb.use_type = #{useType}
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ and sb.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null">
|
|
|
+ and sb.check_id = #{checkId}
|
|
|
+ </if>
|
|
|
+ <if test="isChild != null">
|
|
|
+ and sb.is_child = #{isChild}
|
|
|
+ </if>
|
|
|
+ <if test="isFinancing != null">
|
|
|
+ and sb.is_financing = #{isFinancing}
|
|
|
+ </if>
|
|
|
+ <if test="isShow != null">
|
|
|
+ and sb.is_show = #{isShow}
|
|
|
+ </if>
|
|
|
+ <if test="useArea != null">
|
|
|
+ and sb.use_area = #{useArea}
|
|
|
+ </if>
|
|
|
+ <if test="useCompany != null">
|
|
|
+ and sb.use_company = #{useCompany}
|
|
|
+ </if>
|
|
|
+ <if test="useProject != null">
|
|
|
+ and sb.use_project = #{useProject}
|
|
|
+ </if>
|
|
|
+ <if test="typeId != null">
|
|
|
+ and sb.type_id = #{typeId}
|
|
|
+ </if>
|
|
|
+ <if test="model != null">
|
|
|
+ and sb.model like concat('%',#{model},'%')
|
|
|
+ </if>
|
|
|
+ <if test="useDept != null">
|
|
|
+ and sb.use_dept = #{useDept}
|
|
|
+ </if>
|
|
|
+ <if test="useGroup != null">
|
|
|
+ and sb.use_group = #{useGroup}
|
|
|
+ </if>
|
|
|
+ <if test="nextCheckDateStart != null">
|
|
|
+ and sb.next_check_date <![CDATA[ >= ]]> #{nextCheckDateStart}
|
|
|
+ </if>
|
|
|
+ <if test="nextCheckDateEnd != null">
|
|
|
+ and sb.next_check_date <![CDATA[ <= ]]> #{nextCheckDateEnd}
|
|
|
+ </if>
|
|
|
+ <if test="saveDept != null">
|
|
|
+ and sb.save_dept = #{saveDept}
|
|
|
+ </if>
|
|
|
+ <if test="saveUser != null">
|
|
|
+ and sb.save_user = #{saveUser}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and sb.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="modelId != null">
|
|
|
+ and sb.model_id = #{modelId}
|
|
|
+ </if>
|
|
|
+ <if test="notStatusList != null and notStatusList.size > 0">
|
|
|
+ AND sb.status not in
|
|
|
+ <foreach item="item" index="index" collection="notStatusList" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="statusList != null and statusList.size > 0">
|
|
|
+ AND sb.status in
|
|
|
+ <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sbIds != null and sbIds.size > 0">
|
|
|
+ AND sb.id in
|
|
|
+ <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="ascriptionDept != null and ascriptionDept">
|
|
|
+ <include refid="deptSql"/>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getById" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
|
|
|
+ select
|
|
|
+ <include refid="Left_Column"/>
|
|
|
+ from t_sb_info_measure sb
|
|
|
+ left join t_sb_type sbType on sb.type_id = sbType.id
|
|
|
+ left join t_firm_producer producer on sb.producer_id = producer.id
|
|
|
+ left join t_sb_position position on sb.position_id = position.id
|
|
|
+ left join t_sys_user user on sb.save_user = user.user_id
|
|
|
+ where sb.id = #{value}
|
|
|
+ </select>
|
|
|
+ <select id="getByNo" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
|
|
|
+ select
|
|
|
+ <include refid="Left_Column"/>
|
|
|
+ from t_sb_info_measure sb
|
|
|
+ left join t_sb_type sbType on sb.type_id = sbType.id
|
|
|
+ left join t_firm_producer producer on sb.producer_id = producer.id
|
|
|
+ left join t_sb_position position on sb.position_id = position.id
|
|
|
+ left join t_sys_user user on sb.save_user = user.user_id
|
|
|
+ where sb.no = #{value}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getByIds" parameterType="java.util.List" resultType="com.platform.dao.vo.sb.SbInfoMeasureVO">
|
|
|
+ select
|
|
|
+ <include refid="Left_Column"/>
|
|
|
+ from t_sb_info_measure sb
|
|
|
+ where sb.id in
|
|
|
+ <foreach item="item" index="index" collection="ids" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectNameById" parameterType="Object" resultType="java.lang.String">
|
|
|
+ select name
|
|
|
+ from t_sb_info_measure
|
|
|
+ where id = #{value}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectNoById" parameterType="Object" resultType="java.lang.String">
|
|
|
+ select no
|
|
|
+ from t_sb_info_measure
|
|
|
+ where id = #{value}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateBatch" parameterType="java.util.List">
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ last_baoyang_time=#{item.lastBaoyangTimes},
|
|
|
+ last_baoyang_hours=#{item.lastBaoyangHours},
|
|
|
+ last_baoyang_miles=#{item.lastBaoyangMiles}
|
|
|
+ </set>
|
|
|
+ where id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateBatchQrCode" parameterType="java.util.List">
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ qr_code=#{item.qrCode}
|
|
|
+ </set>
|
|
|
+ where id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateBatchChild" parameterType="java.util.List">
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ parent_id = #{item.parentId}
|
|
|
+ </set>
|
|
|
+ where id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateBatchValue" parameterType="java.util.List">
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ initial_value=#{item.initialValue},
|
|
|
+ current_value=#{item.currentValue},
|
|
|
+ cut_value=#{item.cutValue},
|
|
|
+ month=#{item.month},
|
|
|
+ rate=#{item.rate},
|
|
|
+ used_month=#{item.usedMonth}
|
|
|
+ </set>
|
|
|
+ where id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateStatusByIds" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ status=${status}, update_time=#{updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </set>
|
|
|
+ where
|
|
|
+ id in
|
|
|
+ <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateTotalById" parameterType="java.util.List">
|
|
|
+ <foreach collection="sbInfos" item="item" index="index" open="" close="" separator=";">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ <if test="item.totalHours != null">
|
|
|
+ total_hours= total_hours+#{item.totalHours},
|
|
|
+ </if>
|
|
|
+ <if test="item.totalMiles != null">
|
|
|
+ total_miles=total_miles+#{item.totalMiles},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateBySbIds" parameterType="com.platform.dao.dto.sb.SbInfoMeasureDTO">
|
|
|
+ update t_sb_info_measure
|
|
|
+ <set>
|
|
|
+ <if test="useArea != null">
|
|
|
+ use_area = #{useArea},
|
|
|
+ </if>
|
|
|
+ <if test="useCompany != null">
|
|
|
+ use_company = #{useCompany},
|
|
|
+ </if>
|
|
|
+ <if test="useCompanyName != null">
|
|
|
+ use_company_name = #{useCompanyName},
|
|
|
+ </if>
|
|
|
+ <if test="useProject != null">
|
|
|
+ use_project = #{useProject},
|
|
|
+ </if>
|
|
|
+ <if test="useProjectName != null">
|
|
|
+ use_project_name = #{useProjectName},
|
|
|
+ </if>
|
|
|
+ <if test="useDept != null">
|
|
|
+ use_dept = #{useDept},
|
|
|
+ </if>
|
|
|
+ <if test="useDeptName != null">
|
|
|
+ use_dept_name = #{useDeptName},
|
|
|
+ </if>
|
|
|
+ <if test="useGroup != null">
|
|
|
+ use_group = #{useGroup},
|
|
|
+ </if>
|
|
|
+ <if test="useGroupName != null">
|
|
|
+ use_group_name = #{useGroupName},
|
|
|
+ </if>
|
|
|
+ <if test="saveDept != null">
|
|
|
+ save_dept = #{saveDept},
|
|
|
+ </if>
|
|
|
+ <if test="saveDeptName != null">
|
|
|
+ save_dept_name = #{saveDeptName},
|
|
|
+ </if>
|
|
|
+ <if test="saveUser != null">
|
|
|
+ save_user = #{saveUser},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time=#{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateUserId != null">
|
|
|
+ update_user_id = #{updateUserId},
|
|
|
+ </if>
|
|
|
+ <if test="updateUserName != null">
|
|
|
+ update_user_name = #{updateUserName},
|
|
|
+ </if>
|
|
|
+ <if test="saveUserNull != null and saveUserNull">
|
|
|
+ save_user = null,
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where
|
|
|
+ id in
|
|
|
+ <foreach item="item" index="index" collection="sbIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+</mapper>
|