<?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="repairTypeUserServiceDaoImpl">
|
|
<!-- 保存报修设置信息 add by wuxw 2018-07-03 -->
|
<insert id="saveBusinessRepairTypeUserInfo" parameterType="Map">
|
insert into business_repair_type_user(
|
operate,type_user_id,repair_type,remark,state,staff_name,b_id,community_id,staff_id
|
) values (
|
#{operate},#{typeUserId},#{repairType},#{remark},#{state},#{staffName},#{bId},#{communityId},
|
#{staffId}
|
)
|
</insert>
|
|
|
<!-- 查询报修设置信息(Business) add by wuxw 2018-07-03 -->
|
<select id="getBusinessRepairTypeUserInfo" parameterType="Map" resultType="Map">
|
select t.operate,t.type_user_id,t.type_user_id typeUserId,t.repair_type,t.repair_type
|
repairType,t.remark,t.state,t.staff_name,t.staff_name staffName,t.b_id,t.b_id bId,t.community_id,t.community_id
|
communityId,t.staff_id,t.staff_id staffId
|
from business_repair_type_user t
|
where 1 =1
|
<if test="operate !=null and operate != ''">
|
and t.operate= #{operate}
|
</if>
|
<if test="typeUserId !=null and typeUserId != ''">
|
and t.type_user_id= #{typeUserId}
|
</if>
|
<if test="repairType !=null and repairType != ''">
|
and t.repair_type= #{repairType}
|
</if>
|
<if test="remark !=null and remark != ''">
|
and t.remark= #{remark}
|
</if>
|
<if test="state !=null and state != ''">
|
and t.state= #{state}
|
</if>
|
<if test="staffName !=null and staffName != ''">
|
and t.staff_name= #{staffName}
|
</if>
|
<if test="bId !=null and bId != ''">
|
and t.b_id= #{bId}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
and t.community_id= #{communityId}
|
</if>
|
<if test="staffId !=null and staffId != ''">
|
and t.staff_id= #{staffId}
|
</if>
|
|
</select>
|
|
|
<!-- 保存报修设置信息至 instance表中 add by wuxw 2018-07-03 -->
|
<insert id="saveRepairTypeUserInfoInstance" parameterType="Map">
|
insert into r_repair_type_user(
|
type_user_id,repair_type,remark,status_cd,state,staff_name,b_id,community_id,staff_id
|
) select t.type_user_id,t.repair_type,t.remark,'0',t.state,t.staff_name,t.b_id,t.community_id,t.staff_id from
|
business_repair_type_user t where 1=1
|
and t.operate= 'ADD'
|
<if test="typeUserId !=null and typeUserId != ''">
|
and t.type_user_id= #{typeUserId}
|
</if>
|
<if test="repairType !=null and repairType != ''">
|
and t.repair_type= #{repairType}
|
</if>
|
<if test="remark !=null and remark != ''">
|
and t.remark= #{remark}
|
</if>
|
<if test="state !=null and state != ''">
|
and t.state= #{state}
|
</if>
|
<if test="staffName !=null and staffName != ''">
|
and t.staff_name= #{staffName}
|
</if>
|
<if test="bId !=null and bId != ''">
|
and t.b_id= #{bId}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
and t.community_id= #{communityId}
|
</if>
|
<if test="staffId !=null and staffId != ''">
|
and t.staff_id= #{staffId}
|
</if>
|
|
</insert>
|
|
|
<!-- 查询报修设置信息 add by wuxw 2018-07-03 -->
|
<select id="getRepairTypeUserInfo" parameterType="Map" resultType="Map">
|
select t.type_user_id,t.type_user_id typeUserId,t.repair_type,t.repair_type
|
repairType,t.remark,t.status_cd,t.status_cd statusCd,t.state,t.staff_name,t.staff_name staffName,t.b_id,t.b_id
|
bId,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId,d.name stateName,rrs.repair_type_name repairTypeName,
|
t.create_time createTime
|
from r_repair_type_user t
|
left join t_dict d on t.state = d.status_cd and d.table_name = 'r_repair_type_user' and d.table_columns = 'state'
|
left join r_repair_setting rrs on t.repair_type = rrs.repair_type and rrs.status_cd = '0'
|
where 1 =1
|
<if test="typeUserId !=null and typeUserId != ''">
|
and t.type_user_id= #{typeUserId}
|
</if>
|
<if test="repairType !=null and repairType != ''">
|
and t.repair_type= #{repairType}
|
</if>
|
<if test="remark !=null and remark != ''">
|
and t.remark= #{remark}
|
</if>
|
<if test="statusCd !=null and statusCd != ''">
|
and t.status_cd= #{statusCd}
|
</if>
|
<if test="state !=null and state != ''">
|
and t.state= #{state}
|
</if>
|
<if test="staffName !=null and staffName != ''">
|
and t.staff_name= #{staffName}
|
</if>
|
<if test="bId !=null and bId != ''">
|
and t.b_id= #{bId}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
and t.community_id= #{communityId}
|
</if>
|
<if test="staffId !=null and staffId != ''">
|
and t.staff_id= #{staffId}
|
</if>
|
order by t.create_time desc
|
<if test="page != -1 and page != null ">
|
limit #{page}, #{row}
|
</if>
|
|
</select>
|
|
|
<!-- 修改报修设置信息 add by wuxw 2018-07-03 -->
|
<update id="updateRepairTypeUserInfoInstance" parameterType="Map">
|
update r_repair_type_user t set t.status_cd = #{statusCd}
|
<if test="newBId != null and newBId != ''">
|
,t.b_id = #{newBId}
|
</if>
|
<if test="repairType !=null and repairType != ''">
|
, t.repair_type= #{repairType}
|
</if>
|
<if test="remark !=null and remark != ''">
|
, t.remark= #{remark}
|
</if>
|
<if test="state !=null and state != ''">
|
, t.state= #{state}
|
</if>
|
<if test="staffName !=null and staffName != ''">
|
, t.staff_name= #{staffName}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
, t.community_id= #{communityId}
|
</if>
|
<if test="staffId !=null and staffId != ''">
|
, t.staff_id= #{staffId}
|
</if>
|
where 1=1
|
<if test="typeUserId !=null and typeUserId != ''">
|
and t.type_user_id= #{typeUserId}
|
</if>
|
<if test="bId !=null and bId != ''">
|
and t.b_id= #{bId}
|
</if>
|
|
</update>
|
|
<!-- 查询报修设置数量 add by wuxw 2018-07-03 -->
|
<select id="queryRepairTypeUsersCount" parameterType="Map" resultType="Map">
|
select count(1) count
|
from r_repair_type_user t
|
left join t_dict d on t.state = d.status_cd and d.table_name = 'r_repair_type_user' and d.table_columns = 'state'
|
left join r_repair_setting rrs on t.repair_type = rrs.repair_type and rrs.status_cd = '0'
|
where 1 =1
|
<if test="typeUserId !=null and typeUserId != ''">
|
and t.type_user_id= #{typeUserId}
|
</if>
|
<if test="repairType !=null and repairType != ''">
|
and t.repair_type= #{repairType}
|
</if>
|
<if test="remark !=null and remark != ''">
|
and t.remark= #{remark}
|
</if>
|
<if test="statusCd !=null and statusCd != ''">
|
and t.status_cd= #{statusCd}
|
</if>
|
<if test="state !=null and state != ''">
|
and t.state= #{state}
|
</if>
|
<if test="staffName !=null and staffName != ''">
|
and t.staff_name= #{staffName}
|
</if>
|
<if test="bId !=null and bId != ''">
|
and t.b_id= #{bId}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
and t.community_id= #{communityId}
|
</if>
|
<if test="staffId !=null and staffId != ''">
|
and t.staff_id= #{staffId}
|
</if>
|
|
|
</select>
|
|
</mapper>
|