|
@@ -151,8 +151,6 @@ sb.param_list,
|
|
|
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,
|
|
@@ -172,8 +170,7 @@ sb.apply_time,
|
|
|
sb.remark,
|
|
|
sb.apply_comment,
|
|
|
sb.scrap_user_id,
|
|
|
-sb.scrap_user_name,
|
|
|
-user.real_name as saveUserName
|
|
|
+sb.scrap_user_name
|
|
|
</sql>
|
|
|
|
|
|
<sql id="deptSql">
|
|
@@ -187,18 +184,19 @@ user.real_name as saveUserName
|
|
|
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},'%')
|
|
|
+ and (
|
|
|
+ sb.name like concat('%',#{keyword},'%')
|
|
|
+ or
|
|
|
+ sb.no like concat('%',#{keyword},'%')
|
|
|
+ or
|
|
|
+ sb.card_no like concat('%',#{keyword},'%')
|
|
|
+ )
|
|
|
</if>
|
|
|
<if test="cardNo != null and cardNo!=''">
|
|
|
- and sb.cardNo like concat('%',#{cardNo},'%')
|
|
|
+ and sb.card_no like concat('%',#{cardNo},'%')
|
|
|
</if>
|
|
|
<if test="no != null and no!=''">
|
|
|
and sb.no like concat('%',#{no},'%')
|
|
@@ -206,29 +204,11 @@ user.real_name as saveUserName
|
|
|
<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 test="zzh != null">
|
|
|
+ and sb.zzh = #{zzh}
|
|
|
</if>
|
|
|
<if test="isShow != null">
|
|
|
and sb.is_show = #{isShow}
|
|
@@ -236,36 +216,13 @@ user.real_name as saveUserName
|
|
|
<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>
|
|
@@ -314,120 +271,11 @@ user.real_name as saveUserName
|
|
|
</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 != ''">
|
|
@@ -435,49 +283,21 @@ user.real_name as saveUserName
|
|
|
sb.name like concat('%',#{keyword},'%')
|
|
|
or
|
|
|
sb.no like concat('%',#{keyword},'%')
|
|
|
+ or
|
|
|
+ sb.card_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 test="zzh != null">
|
|
|
+ and sb.zzh = #{zzh}
|
|
|
</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 test="zzh != null">
|
|
|
+ and sb.zzh = #{zzh}
|
|
|
</if>
|
|
|
<if test="model != null">
|
|
|
and sb.model like concat('%',#{model},'%')
|
|
@@ -485,21 +305,12 @@ user.real_name as saveUserName
|
|
|
<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>
|
|
@@ -518,35 +329,18 @@ user.real_name as saveUserName
|
|
|
#{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>
|
|
|
|
|
@@ -618,93 +412,4 @@ user.real_name as saveUserName
|
|
|
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>
|