123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857 |
- <?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.SbInfoMapper">
- <sql id="Base_Column_List">
- id
- , no,
- financing_no,
- position_no,pp_no,
- financing_no_two,
- financing_no_third,
- financing_no_four,
- financing_no_five,
- param_list,
- name, model_id,
- is_child, is_measure, measure_status,is_self,
- 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.position_no,
- sb.pp_no,
- sb.name, sb.initial_value,
- sb.current_value, sb.cut_value,
- sb.is_child, sb.is_measure, sb.measure_status,sb.is_self,
- 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,
- 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,sb.repair_dept_id
- </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.SbInfoDTO"
- resultType="com.platform.dao.vo.sb.SbInfoVO">
- select
- <include refid="Left_Column"/>
- from t_sb_info sb
- left join t_sb_type sbType on sb.type_id = sbType.id
- left join t_sb_position position on sb.position_id = position.id
- left join t_sys_user user2 on sb.repair_user = user2.user_id
- left join t_sys_user user3 on sb.repair_user_second = user3.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},'%')
- or
- sb.no like concat('%',#{keyword},'%')
- )
- </if>
- <if test="name != null and name!=''">
- and sb.name like concat('%',#{name},'%')
- </if>
- <if test="zbh != null and zbh!=''">
- and sb.zbh like concat('%',#{zbh},'%')
- </if>
- <if test="repairUserName != null and repairUserName!=''">
- and user2.real_name like concat('%',#{repairUserName},'%')
- </if>
- <if test="repairUserSecondName != null and repairUserSecondName!=''">
- and user3.real_name like concat('%',#{repairUserSecondName},'%')
- </if>
- <if test="producerName != null and producerName!=''">
- and sb.producer_id like concat('%',#{producerName},'%')
- </if>
- <if test="producerId != null and producerId!=''">
- and sb.producer_id like concat('%',#{producerId},'%')
- </if>
- <if test="positionId != null and positionId!=''">
- and sb.position_id = #{positionId}
- </if>
- <if test="positionNo != null and positionNo!=''">
- and sb.position_no like concat('%',#{positionNo},'%')
- </if>
- <if test="ppNo != null and ppNo!=''">
- and sb.pp_no like concat('%',#{ppNo},'%')
- </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="ids != null">
- AND sb.id in
- <foreach item="item" index="index" collection="ids" 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="isMeasure != null">
- and sb.is_measure = #{isMeasure}
- </if>
- <if test="isSelf != null">
- and sb.is_self = #{isSelf}
- </if>
- <if test="measureStatus != null">
- and sb.measure_status = #{measureStatus}
- </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="baoyangTimes != null">
- and sb.baoyang_times = #{baoyangTimes}
- </if>
- <if test="typeId != null and typeId != ''">
- 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="cph != null">
- and sb.model like concat('%',#{cph},'%')
- </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="checkDateStart != null">
- and sb.check_date <![CDATA[ >= ]]> #{checkDateStart}
- </if>
- <if test="checkDateEnd != null">
- and sb.check_date <![CDATA[ <= ]]> #{checkDateEnd}
- </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.SbInfoDTO"
- resultType="com.platform.dao.vo.sb.SbInfoVO">
- 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 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="name != null and name!=''">
- and sb.name like concat('%',#{name},'%')
- </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="baoyangTimes != null">
- and sb.baoyang_times = #{baoyangTimes}
- </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="isMeasure != null">
- and sb.is_measure = #{isMeasure}
- </if>
- <if test="isSelf != null">
- and sb.is_self = #{isSelf}
- </if>
- <if test="positionNo != null and positionNo!=''">
- and sb.position_no like concat('%',#{positionNo},'%')
- </if>
- <if test="ppNo != null and ppNo!=''">
- and sb.pp_no like concat('%',#{ppNo},'%')
- </if>
- <if test="measureStatus != null">
- and sb.measure_status = #{measureStatus}
- </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.SbInfoDTO"
- resultType="com.platform.dao.vo.sb.SbInfoScreenDetailVO">
- select
- sb.id, sb.no, sb.zjm, sb.jbdh, sb.level
- from t_sb_info 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.SbInfoDTO"
- resultType="com.platform.dao.vo.sb.SbInfoVO">
- select sb.*
- from t_sb_info sb
- 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="name != null and name!=''">
- and sb.name like concat('%',#{name},'%')
- </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="useTypeList != null">
- AND sb.use_type in
- <foreach item="item" index="index" collection="useTypeList" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="useType != null">
- and sb.use_type = #{useType}
- </if>
- <if test="isMeasure != null">
- and sb.is_measure = #{isMeasure}
- </if>
- <if test="isSelf != null">
- and sb.is_self = #{isSelf}
- </if>
- <if test="positionNo != null and positionNo!=''">
- and sb.position_no like concat('%',#{positionNo},'%')
- </if>
- <if test="ppNo != null and ppNo!=''">
- and sb.pp_no like concat('%',#{ppNo},'%')
- </if>
- <if test="measureStatus != null">
- and sb.measure_status = #{measureStatus}
- </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="baoyangTimes != null">
- and sb.baoyang_times = #{baoyangTimes}
- </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.SbInfoVO">
- select
- <include refid="Left_Column"/>
- from t_sb_info sb
- left join t_sb_type sbType on sb.type_id = sbType.id
- left join t_sb_position position on sb.position_id = position.id
- where sb.id = #{value}
- </select>
- <select id="getByNo" parameterType="java.lang.Object" resultType="com.platform.dao.vo.sb.SbInfoVO">
- select
- <include refid="Left_Column"/>
- from t_sb_info sb
- left join t_sb_type sbType on sb.type_id = sbType.id
- left join t_sb_position position on sb.position_id = position.id
- where sb.no = #{value}
- </select>
- <select id="getByIds" parameterType="java.util.List" resultType="com.platform.dao.vo.sb.SbInfoVO">
- select
- <include refid="Left_Column"/>
- from t_sb_info 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
- where id = #{value}
- </select>
- <select id="selectNoById" parameterType="Object" resultType="java.lang.String">
- select no
- from t_sb_info
- 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
- <set>
- <if test="item.measureStatus != null">
- measure_status= #{item.measureStatus}
- </if>
- </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
- <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
- <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
- <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.SbInfoDTO">
- update t_sb_info
- <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
- <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.SbInfoDTO">
- update t_sb_info
- <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>
- <select id="getSbTree" parameterType="com.platform.dao.dto.sb.SbInfoDTO"
- resultType="com.platform.dao.vo.sb.SbTreeVO">
- SELECT info.id,info.name,bom.* FROM
- t_sb_info info JOIN t_sb_model_spare_bom bom ON
- info.id=bom.`sb_id`
- WHERE bom.sb_id=#{id}
- </select>
- <select id="getSubSb" parameterType="com.platform.dao.dto.sb.SbInfoDTO"
- resultType="com.platform.dao.vo.sb.SbInfoVO">
- select id,name from t_sb_info where parent_id=#{id}
- </select>
- <select id="selectCountByPosition" parameterType="java.lang.String"
- resultType="java.lang.Integer">
- select count(info.id)
- from t_sb_info info
- left join t_sb_position position on info.position_id = position.id
- where position.code like concat(#{code},'%')
- </select>
- <select id="selectCountByPositionGroup" parameterType="java.lang.String"
- resultType="java.util.Map">
- select position.id, position.name, position.code, position.type, position.parent_id parentId,
- count(info.id) as num
- from t_sb_position position
- left join t_sb_info info on info.position_id=position.id
- where position.type in (1, 2) and position.del_flag=0
- group By position.id
- </select>
- <select id="selectCountByStatusGroup" parameterType="java.lang.String"
- resultType="java.util.Map">
- select info.status, count(info.id) as num
- from t_sb_info info, t_sb_position position
- where
- info.position_id = position.id
- and position.code like concat(#{code},'%') and position.del_flag=0
- group By info.status
- </select>
- <select id="selectCountByUseTypeGroup" parameterType="java.lang.String"
- resultType="java.util.Map">
- select info.use_type useType, count(info.id) as num
- from t_sb_info info, t_sb_position position
- where
- info.position_id = position.id
- and position.code like concat(#{code},'%') and position.del_flag=0
- group By info.use_type
- </select>
- <select id="selectCountMap" parameterType="com.platform.dao.dto.sb.SbInfoDTO"
- resultType="java.util.Map">
- select count(*) as num, type_id as typeId from t_sb_info
- <if test="useType != null">
- where use_type = #{useType}
- </if>
- GROUP BY type_id
- </select>
- <update id="updateLongYanForInStore" parameterType="com.platform.dao.dto.sb.SbInfoDTO">
- update t_sb_info set status = #{status},position_id = null,positionNo = null,ppNo = null,parentId = null where id = #{id}
- </update>
- </mapper>
|