Browse Source

feat:剥离出专项督察明细后,大屏sql修改

feature/tsjb-1.0
buaixuexideshitongxue 3 weeks ago
parent
commit
1133cee5ca
  1. 17
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  2. 31
      src/main/resources/mapper/NegativeMapper.xml

17
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -311,17 +311,12 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Param("codes") List<String> codes @Param("codes") List<String> codes
); );
@Select("select ng.* from negative ng " + List<Negative> getYellowBetNegativeList(
"LEFT JOIN sup_depart sd on ng.involveDepartId = sd.id " + @Param("id") String id,
"LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + @Param("beginTime") Date beginTime,
"LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + @Param("endTime") Date endTime,
"where " + @Param("specialSupervision") String specialSupervision
"ng.special_supervision =#{specialSupervision} " + );
"and ng.crtTime >= #{beginTime} " +
"and ng.crtTime <= #{endTime} " +
"AND (sd.id =#{id} OR sdd.id=#{id} or sddd.id=#{id});"
)
List<Negative> getYellowBetNegativeList(String id, Date beginTime, Date endTime, String specialSupervision);

31
src/main/resources/mapper/NegativeMapper.xml

@ -0,0 +1,31 @@
<?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.biutag.supervision.mapper.NegativeMapper">
<select id="getYellowBetNegativeList" resultType="com.biutag.supervision.pojo.entity.Negative">
SELECT ng.* FROM negative ng
LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id
LEFT JOIN sup_depart sdd ON sd.pid = sdd.id
LEFT JOIN sup_depart sddd ON sdd.pid = sddd.id
<where>
<if test="beginTime != null">
AND ng.crtTime &gt;= #{beginTime}
</if>
<if test="endTime != null">
AND ng.crtTime &lt;= #{endTime}
</if>
<if test="id != null and id != ''">
AND (sd.id = #{id} OR sdd.id = #{id} OR sddd.id = #{id})
</if>
<choose>
<when test="specialSupervision != null and specialSupervision != ''">
AND FIND_IN_SET(#{specialSupervision}, ng.special_supervision) &gt; 0
</when>
<otherwise>
</otherwise>
</choose>
</where>
</select>
</mapper>
Loading…
Cancel
Save