123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- <?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.welampiot.dao.DefectManageDao">
-
- <insert id="addDefectManage" keyProperty="id" useGeneratedKeys="true" parameterType="DefectManageDTO">
- insert into defect_manage(open_time, location, dev_type, dev_name, script, create_time, `level`, user_id, longitude, latitude, sectionid)
- values (#{openTime},#{location},#{devType},#{devName},#{script},#{createTime},#{level},#{userid},#{longitude},#{latitude},#{sectionId})
- </insert>
- <update id="updateDefectManage" parameterType="DefectManageDTO">
- update defect_manage d
- set
- d.open_time = #{openTime},
- d.location = #{location},
- d.dev_type = #{devType},
- d.dev_name = #{devName},
- d.script = #{script},
- d.create_time = #{createTime},
- d.level = #{level},
- d.user_id = #{userid},
- d.longitude = #{longitude},
- d.latitude = #{latitude},
- d.sectionId = #{sectionId}
- where d.id = #{id}
- </update>
- <!-- 更新工单状态 -->
- <update id="updateDefectManageStatus" parameterType="DefectManageDTO">
- update defect_manage d
- set
- d.status = #{status}
- where d.id = #{id}
- </update>
- <select id="getUseridById" resultType="Integer">
- select d.user_id as userid
- from defect_manage d
- where d.id = #{id}
- </select>
- <select id="getDefectManageListByVO" resultType="DefectManageDTO" parameterType="DefectManageVO">
- select d.id,d.number,d.open_time openTime,d.script,d.location,d.status,
- d.level,d.work_name as workName
- from defect_manage d
- left join defect_manage_file dmf on d.id = dmf.defect_manage_id
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- where 1=1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="sectionId != null and sectionId != 0">
- and s.id = #{sectionId}
- </if>
- <if test="areaId != null and areaId != 0">
- and gl.id = #{areaId}
- </if>
- <if test="cityId != null and cityId != 0">
- and gl1.id = #{cityId}
- </if>
- <if test="provinceId != null and provinceId != 0">
- and gl2.id = #{provinceId}
- </if>
- <if test="keyword != null and keyword != ''">
- and d.number like '%${keyword}%'
- </if>
- <choose>
- <when test="status == 4">
- and d.status = 4
- </when>
- <when test="status == 3">
- and d.status = 3
- </when>
- <when test="status == 2">
- and d.status = 2
- </when>
- <when test="status == 1">
- and d.status = 1
- </when>
- <otherwise>
- and d.status = 0
- </otherwise>
- </choose>
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <!-- 总数 -->
- <select id="getDefectManageTotal" resultType="Integer" parameterType="DefectManageVO">
- select count(d.id) as total
- from defect_manage d
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- <if test="sectionList != null and !sectionList.isEmpty()">
- where d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!-- 未派发数 -->
- <select id="getDefectManageTotal2" resultType="Integer" parameterType="DefectManageVO">
- select count(d.id) as total
- from defect_manage d
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- where d.status = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!-- 处理中数 -->
- <select id="getDefectManageTotal3" resultType="Integer" parameterType="DefectManageVO">
- select count(d.id) as total
- from defect_manage d
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- where d.status = 1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!-- 复核数 -->
- <select id="getDefectManageTotal4" resultType="Integer" parameterType="DefectManageVO">
- select count(d.id) as total
- from defect_manage d
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- where d.status = 2
- <if test="sectionList != null and !sectionList.isEmpty()">
- and d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!-- 结案数 -->
- <select id="getDefectManageTotal5" resultType="Integer" parameterType="DefectManageVO">
- select count(d.id) as total
- from defect_manage d
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- where d.status = 3
- <if test="sectionList != null and !sectionList.isEmpty()">
- and d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!-- 归档数 -->
- <select id="getDefectManageTotal6" resultType="Integer" parameterType="DefectManageVO">
- select count(d.id) as total
- from defect_manage d
- left join section s on d.sectionId = s.id
- left join global_location gl on s.pid = gl.id
- left join global_location gl1 on gl.pid = gl1.id
- left join global_location gl2 on gl1.pid = gl2.id
- where d.status = 4
- <if test="sectionList != null and !sectionList.isEmpty()">
- and d.sectionId in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!-- 工单详情 -->
- <select id="getDefectManageInfoById" resultType="DefectManageDTO">
- select d.id,d.number,d.open_time openTime,d.script,
- d.level,d.location,d.longitude,d.latitude
- from defect_manage d
- where d.id = #{id}
- </select>
- </mapper>
|