This commit is contained in:
esacpe
2024-07-17 21:00:42 +08:00
commit b80c560e87
1931 changed files with 163526 additions and 0 deletions

View File

@ -0,0 +1,75 @@
ribbon:
ReadTimeout: 600000
ConnectTimeout: 600000
spring:
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
jackson:
serialization:
write-dates-as-timestamps: false
# # 格式化返回时间 yyyy-MM-dd HH:mm:ss
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.200.131:3306/mosty_qwgl?autoReconnect=true&failOverReadOnly=false&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
username: root
password: mosty888
hikari:
minimum-idle: 10 # ??????????10???0???maximum-pool-size??????maximum-pool-size
maximum-pool-size: 20 # ??????????0????????10??????1?????minimum-idle??
idle-timeout: 500000 # ????????????600000?10????????max-lifetime?max-lifetime>0??????0????0???10???????10??
max-lifetime: 540000 # ????????????0???30??????????30??.?????mysql????????
connection-timeout: 60000 # ????????????250????????????30?
connection-test-query: SELECT 1 # ???????????????
# Redis数据库索引默认为0
redis:
database: 8
# Redis服务器地址
host: 192.168.200.131
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码默认为空
password: mosty888
# 连接超时时间(毫秒)
timeout: 2000
jedis:
pool:
max-active: 50
swagger:
host: 80.155.0.84
port: 8010
mybatis-plus:
global-config:
db-config:
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
magic-api:
web: /magic/web
#配置文件存储位置。当以classpath开头时为只读模式
resource:
# location: /data/magic-api
type: database
table-name: magic_api # 数据库中的表名
prefix: /magic-api # 前缀
datasource:
response-code:
success: 10000
exclude:
pathPatterns:
swagger:
- /swagger-resources/**
- /webjars/**
- /v2/**
- /swagger-ui.html/**
- /docs.html/**
config:
orgCode: 510600000000

View File

@ -0,0 +1,39 @@
server:
port: 8010
servlet:
context-path: /mosty-qwzx/
spring:
application:
name: mosty-qwzx
cloud:
nacos:
discovery:
namespace: 657d1843-b590-41ac-b5e7-5d261bf00de9
server-addr: 192.168.200.131:8848
register-enabled: true # 是否将自己注册到配置中心,让其他服务发现调用(本地调试使用)
# 开启健康监控
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: always
auditevents:
enabled: true
#swagger:
# enable: true
# title: 基础微服务
# version: 1.0.0
# name: 基础微服务
# url: ''
# email: ''
# 日志
#logging:
# file: /application/applogs/admin.log

View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<jmxConfigurator/>
<property name="PROJECT_NAME" value="msxf-retail-sort" />
<property name="LOG_FILE_INFO" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/msxf-retail-sort-info.log" />
<property name="LOG_FILE_WARN" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/msxf-retail-sort-warn.log" />
<property name="LOG_FILE_ERR" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/msxf-retail-sort-error.log" />
<property name="LOG_BUSINESS" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/business/business-2de.log"/>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<contextName>${PROJECT_NAME}</contextName>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
</encoder>
</appender>
<appender name="LOG_FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
</encoder>
<file>${LOG_FILE_INFO}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_INFO}-7de.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>1024MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<appender name="LOG_FILE_WARN"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
</encoder>
<file>${LOG_FILE_WARN}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_WARN}-30de.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>1024MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<appender name="LOG_FILE_ERROR"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
</encoder>
<file>${LOG_FILE_ERR}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_ERR}.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>512MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<!--添加监控日志 -->
<appender name="business-log-appender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<file>${LOG_BUSINESS}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_BUSINESS}.%d{yyyy-MM-dd}.%i
</fileNamePattern>
<maxFileSize>1024MB</maxFileSize>
</rollingPolicy>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
<logger name="business-log" additivity="false" level="info">
<appender-ref ref="business-log-appender"/>
<appender-ref ref="CONSOLE" />
</logger>
<!-- show parameters for hibernate sql 专为 Hibernate 定制 -->
<logger name="logging.level.jdbc" level="INFO" />
<logger name="logging.level.jdbc.sqlonly" level="INFO" />
<logger name="org.springframework" level="INFO" additivity="true" />
<Logger name="jdbc.sqlonly" level="info" />
<Logger name="jdbc.sqltiming" level="warn" />
<Logger name="jdbc.audit" level="warn" />
<Logger name="jdbc.resultset" level="warn" />
<Logger name="jdbc.resultsettable" level="warn" />
<logger name="jdbc.connection" level="warn" />
<Logger name="log4jdbc.debug" level="warn" />
<Logger name="org.apache.kafka.clients.NetworkClient" level="ERROR" />
<root level="INFO">
<!-- <appender-ref ref="CONSOLE" />-->
<!-- <appender-ref ref="LOG_FILE_INFO" />-->
<!-- <appender-ref ref="LOG_FILE_WARN" />-->
<appender-ref ref="LOG_FILE_ERROR" />
</root>
</configuration>

View File

@ -0,0 +1,43 @@
<?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.mosty.qwzx.mapper.QwzxQwlbMapper">
<select id="qxjMjlb" resultType="java.util.Map">
select * from mosty_qwgl.tb_qw_qxj
where xt_sjzt = '1' and xt_scbz = '0'
<if test="dto.qjrq != null and dto.qjrq != ''">
and #{dto.qjrq} between date_format(kssj,'%Y-%m-%d') and date_format(jssj,'%Y-%m-%d')
</if>
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
and ssbmid like concat(#{dto.ssbmdm,jdbcType=VARCHAR},'%')
</if>
<!-- ${useSql}-->
</select>
<select id="jmxz" resultType="java.util.Map">
select * from tb_qw_xfbb where xt_scbz='0' and xt_sjzt='1'
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
and ssbmdm like concat(#{dto.ssbmdm,jdbcType=VARCHAR},'%')
</if>
<!-- <if test="dto.ssbmid != null and dto.ssbmid != ''">-->
<!-- and ssbmid = #{dto.ssbmid}-->
<!-- </if>-->
<!-- ${useSql}-->
limit #{pageIndex},#{pageSize}
</select>
<select id="jmxzCount" resultType="int">
select * from tb_qw_xfbb where xt_scbz='0' and xt_sjzt='1'
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
and ssbmdm like concat(#{dto.ssbmdm,jdbcType=VARCHAR},'%')
</if>
<!-- <if test="dto.ssbmid != null and dto.ssbmid != ''">-->
<!-- and ssbmid = #{dto.ssbmid}-->
<!-- </if>-->
<!-- ${useSql}-->
</select>
</mapper>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
<?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.mosty.qwzx.mapper.TbQwBmjlbbJlmxMapper">
<!--根据ID删除警力明细-->
<update id="deleteJlmx">
update tb_qw_bmjlbb_jlmx set xt_scbz = '1' where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<!--根据ID删除明细-->
<update id="deleteByJlbbId">
delete
from tb_qw_bmjlbb_jlmx
where jlbb_id = #{qwjzId}
</update>
</mapper>

View File

@ -0,0 +1,105 @@
<?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.mosty.qwzx.mapper.TbQwBmjlbbMapper">
<resultMap id="BaseResultMap" type="com.mosty.base.model.vo.qwzx.TbQwBmjlbbVo">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="bbrq" property="bbrq" />
<result column="sfjjr" property="sfjjr" />
<result column="jjrmc" property="jjrmc" />
<result column="qwdj_id" property="qwdjId" />
<result column="qwdjdm" property="qwdjdm" />
<result column="qwdj" property="qwdj" />
<result column="kssj" property="kssj" />
<result column="jssj" property="jssj" />
<result column="zgmjsl" property="zgmjsl" />
<result column="zgmj" property="zgmj" />
<result column="zgfjsl" property="zgfjsl" />
<result column="zgfj" property="zgfj" />
<result column="zbjlsl" property="zbjlsl" />
<result column="zbjl" property="zbjl" />
<result column="bzmjlsl" property="bzmjlsl" />
<result column="bzgmj" property="bzgmj" />
<result column="bzgfjsl" property="bzgfjsl" />
<result column="bzgfj" property="bzgfj" />
<result column="ssbm" property="ssbm" />
<result column="ssbmdm" property="ssbmdm" />
<result column="ssxgaj" property="ssxgaj" />
<result column="ssxgajdm" property="ssxgajdm" />
<result column="sssgaj" property="sssgaj" />
<result column="sssgajdm" property="sssgajdm" />
<result column="bz" property="bz" />
<collection property="zbjlList" ofType="com.mosty.base.model.dto.qwzx.TbQwBmjlbbJlmxDto">
<result column="id" property="id" />
<result column="jlbb_id" property="jlbbId" />
<result column="jl_id" property="jlId" />
<result column="jllx" property="jllx" />
<result column="jlxm" property="jlxm" />
<result column="sfzh" property="sfzh" />
<result column="jh" property="jh" />
<result column="xbdm" property="xbdm" />
<result column="nl" property="nl" />
<result column="jlzt" property="jlzt" />
<result column="bblx" property="bblx" />
</collection>
<collection property="zgjlList" ofType="com.mosty.base.model.dto.qwzx.TbQwBmjlbbJlmxDto">
<result column="id" property="id" />
<result column="jlbb_id" property="jlbbId" />
<result column="jl_id" property="jlId" />
<result column="jllx" property="jllx" />
<result column="jlxm" property="jlxm" />
<result column="sfzh" property="sfzh" />
<result column="jh" property="jh" />
<result column="xbdm" property="xbdm" />
<result column="nl" property="nl" />
<result column="jlzt" property="jlzt" />
<result column="bblx" property="bblx" />
</collection>
<collection property="bzgjlList" ofType="com.mosty.base.model.dto.qwzx.TbQwBmjlbbJlmxDto">
<result column="id" property="id" />
<result column="jlbb_id" property="jlbbId" />
<result column="jl_id" property="jlId" />
<result column="jllx" property="jllx" />
<result column="jlxm" property="jlxm" />
<result column="sfzh" property="sfzh" />
<result column="jh" property="jh" />
<result column="xbdm" property="xbdm" />
<result column="nl" property="nl" />
<result column="jlzt" property="jlzt" />
<result column="bblx" property="bblx" />
</collection>
</resultMap>
<select id="selectOnCop" resultType="com.mosty.base.model.vo.qwzx.Gzqk">
select count(1) zgmjsl,
(select count(1) zgfjsl from tb_qw_bmjlbb_jlmx a where DATE_FORMAT(a.bbrq,'%Y-%m-%d')=
DATE_FORMAT(NOW(),'%Y-%m-%d') and a.xt_scbz = '0' and a.xt_sjzt = '1' and a.jlzt = '1' and
a.jllx = '02'
<if test="ssbmdm != null and ssbmdm != ''">
and a.ssbmdm like concat(#{ssbmdm,jdbcType=VARCHAR},'%')
</if>
) as zgfjsl
from tb_qw_bmjlbb_jlmx a where DATE_FORMAT(a.bbrq,'%Y-%m-%d')=
DATE_FORMAT(NOW(),'%Y-%m-%d') and a.xt_scbz = '0' and a.xt_sjzt = '1' and a.jlzt = '1'
and a.jllx = '01'
<if test="ssbmdm != null and ssbmdm != ''">
and a.ssbmdm like concat(#{ssbmdm,jdbcType=VARCHAR},'%')
</if>
</select>
<select id="jlbbCount" resultType="com.mosty.base.model.vo.qwzx.TbQwBmjlbbCountVo">
select SUM(zgmjsl) as zgmjs,SUM(zgfjsl) as zgfjs,SUM(bzmjlsl) as bzgmjs,SUM(bzgfjsl) as bzgfjs
from tb_qw_bmjlbb
<if test="params.kssj != null and params.jssj == null">
and a.bbrq &gt;= #{params.kssj,jdbcType=DATE}
</if>
<if test="params.kssj == null and params.jssj != null">
and a.bbrq &lt;= #{params.jssj,jdbcType=DATE}
</if>
<if test="params.kssj != null and params.jssj != null">
and a.bbrq between #{params.kssj,jdbcType=DATE} and #{params.jssj,jdbcType=DATE}
</if>
</select>
</mapper>

View File

@ -0,0 +1,27 @@
<?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.mosty.qwzx.mapper.TbQwClMapper">
<!--根据ID删除勤务车辆明细-->
<update id="deleteCl">
update tb_qw_cl set xt_scbz = '1' where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<!--根据业务ID删除明细-->
<update id="deleteByYwid">
delete from tb_qw_cl where ywid = #{ywid}
</update>
<select id="queryListByYwid" resultType="com.mosty.base.model.entity.qwzx.TbQwCl">
select a.* from tb_qw_cl a
where a.xt_scbz = '0'
and a.ywid in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

View File

@ -0,0 +1,11 @@
<?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.mosty.qwzx.mapper.TbQwJjrMapper">
<delete id="deleteBatch">
delete from tb_qw_jjr where id in
<foreach collection="list" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,561 @@
<?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.mosty.qwzx.mapper.TbQwJlMapper">
<resultMap type="com.mosty.base.model.entity.qwzx.TbQwJl" id="TbQwJlMap">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="ywid" column="ywid" jdbcType="VARCHAR"/>
<result property="jllx" column="jllx" jdbcType="VARCHAR"/>
<result property="jlId" column="jl_id" jdbcType="VARCHAR"/>
<result property="jlxm" column="jlxm" jdbcType="VARCHAR"/>
<result property="sfzh" column="sfzh" jdbcType="VARCHAR"/>
<result property="lxdh" column="lxdh" jdbcType="VARCHAR"/>
<result property="xbdm" column="xbdm" jdbcType="VARCHAR"/>
<result property="nl" column="nl" jdbcType="INTEGER"/>
<result property="jlzt" column="jlzt" jdbcType="VARCHAR"/>
<result property="zblx" column="zblx" jdbcType="VARCHAR"/>
<result property="ssbm" column="ssbm" jdbcType="VARCHAR"/>
<result property="ssbmdm" column="ssbmdm" jdbcType="VARCHAR"/>
<result property="ssxgaj" column="ssxgaj" jdbcType="VARCHAR"/>
<result property="ssxgajdm" column="ssxgajdm" jdbcType="VARCHAR"/>
<result property="sssgaj" column="sssgaj" jdbcType="VARCHAR"/>
<result property="sssgajdm" column="sssgajdm" jdbcType="VARCHAR"/>
<result property="xtSjly" column="xt_sjly" jdbcType="VARCHAR"/>
<result property="xtSjzt" column="xt_sjzt" jdbcType="VARCHAR"/>
<result property="xtScbz" column="xt_scbz" jdbcType="VARCHAR"/>
<result property="xtCjip" column="xt_cjip" jdbcType="VARCHAR"/>
<result property="xtCjsj" column="xt_cjsj" jdbcType="VARCHAR"/>
<result property="xtCjrId" column="xt_cjr_id" jdbcType="VARCHAR"/>
<result property="xtCjr" column="xt_cjr" jdbcType="VARCHAR"/>
<result property="xtCjbmdm" column="xt_cjbmdm" jdbcType="VARCHAR"/>
<result property="xtCjbmmc" column="xt_cjbmmc" jdbcType="VARCHAR"/>
<result property="xtZhgxip" column="xt_zhgxip" jdbcType="VARCHAR"/>
<result property="xtZhgxsj" column="xt_zhgxsj" jdbcType="VARCHAR"/>
<result property="xtZhgxrid" column="xt_zhgxrid" jdbcType="VARCHAR"/>
<result property="xtZhgxr" column="xt_zhgxr" jdbcType="VARCHAR"/>
<result property="xtZhgxbmdm" column="xt_zhgxbmdm" jdbcType="VARCHAR"/>
<result property="xtZhgxbm" column="xt_zhgxbm" jdbcType="VARCHAR"/>
<result property="bz" column="bz" jdbcType="VARCHAR"/>
</resultMap>
<!--查询所有-->
<select id="queryAll" resultMap="TbQwJlMap">
select id,
ywid,
jllx,
jl_id,
jlxm,
sfzh,
xbdm,
nl,
jlzt,
zblx,
ssbm,
ssbmdm,
ssxgaj,
ssxgajdm,
sssgaj,
sssgajdm,
xt_sjly,
xt_sjzt,
xt_scbz,
xt_cjip,
xt_cjsj,
xt_cjr_id,
xt_cjr,
xt_cjbmdm,
xt_cjbmmc,
xt_zhgxip,
xt_zhgxsj,
xt_zhgxrid,
xt_zhgxr,
xt_zhgxbmdm,
xt_zhgxbm,
bz
from tb_qw_jl
</select>
<!--查询单个-->
<select id="queryById" resultMap="TbQwJlMap">
select id,
ywid,
jllx,
jl_id,
jlxm,
sfzh,
xbdm,
nl,
jlzt,
zblx,
ssbm,
ssbmdm,
ssxgaj,
ssxgajdm,
sssgaj,
sssgajdm,
xt_sjly,
xt_sjzt,
xt_scbz,
xt_cjip,
xt_cjsj,
xt_cjr_id,
xt_cjr,
xt_cjbmdm,
xt_cjbmmc,
xt_zhgxip,
xt_zhgxsj,
xt_zhgxrid,
xt_zhgxr,
xt_zhgxbmdm,
xt_zhgxbm,
bz
from tb_qw_jl
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TbQwJlMap">
select
id, ywid, jllx, jl_id, jlxm, sfzh, xbdm, nl, jlzt, zblx, ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm,
xt_sjly, xt_sjzt, xt_scbz, xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj,
xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz
from tb_qw_jl
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="ywid != null and ywid != ''">
and ywid = #{ywid}
</if>
<if test="jllx != null and jllx != ''">
and jllx = #{jllx}
</if>
<if test="jlId != null and jlId != ''">
and jl_id = #{jlId}
</if>
<if test="jlxm != null and jlxm != ''">
and jlxm = #{jlxm}
</if>
<if test="sfzh != null and sfzh != ''">
and sfzh = #{sfzh}
</if>
<if test="xbdm != null and xbdm != ''">
and xbdm = #{xbdm}
</if>
<if test="nl != null">
and nl = #{nl}
</if>
<if test="jlzt != null and jlzt != ''">
and jlzt = #{jlzt}
</if>
<if test="zblx != null and zblx != ''">
and zblx = #{zblx}
</if>
<if test="ssbm != null and ssbm != ''">
and ssbm = #{ssbm}
</if>
<if test="ssbmdm != null and ssbmdm != ''">
and ssbmdm = #{ssbmdm}
</if>
<if test="ssxgaj != null and ssxgaj != ''">
and ssxgaj = #{ssxgaj}
</if>
<if test="ssxgajdm != null and ssxgajdm != ''">
and ssxgajdm = #{ssxgajdm}
</if>
<if test="sssgaj != null and sssgaj != ''">
and sssgaj = #{sssgaj}
</if>
<if test="sssgajdm != null and sssgajdm != ''">
and sssgajdm = #{sssgajdm}
</if>
<if test="xtSjly != null and xtSjly != ''">
and xt_sjly = #{xtSjly}
</if>
<if test="xtSjzt != null and xtSjzt != ''">
and xt_sjzt = #{xtSjzt}
</if>
<if test="xtScbz != null and xtScbz != ''">
and xt_scbz = #{xtScbz}
</if>
<if test="xtCjip != null and xtCjip != ''">
and xt_cjip = #{xtCjip}
</if>
<if test="xtCjsj != null">
and xt_cjsj = #{xtCjsj}
</if>
<if test="xtCjrId != null and xtCjrId != ''">
and xt_cjr_id = #{xtCjrId}
</if>
<if test="xtCjr != null and xtCjr != ''">
and xt_cjr = #{xtCjr}
</if>
<if test="xtCjbmdm != null and xtCjbmdm != ''">
and xt_cjbmdm = #{xtCjbmdm}
</if>
<if test="xtCjbmmc != null and xtCjbmmc != ''">
and xt_cjbmmc = #{xtCjbmmc}
</if>
<if test="xtZhgxip != null and xtZhgxip != ''">
and xt_zhgxip = #{xtZhgxip}
</if>
<if test="xtZhgxsj != null">
and xt_zhgxsj = #{xtZhgxsj}
</if>
<if test="xtZhgxrid != null and xtZhgxrid != ''">
and xt_zhgxrid = #{xtZhgxrid}
</if>
<if test="xtZhgxr != null and xtZhgxr != ''">
and xt_zhgxr = #{xtZhgxr}
</if>
<if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
and xt_zhgxbmdm = #{xtZhgxbmdm}
</if>
<if test="xtZhgxbm != null and xtZhgxbm != ''">
and xt_zhgxbm = #{xtZhgxbm}
</if>
<if test="bz != null and bz != ''">
and bz = #{bz}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from tb_qw_jl
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="ywid != null and ywid != ''">
and ywid = #{ywid}
</if>
<if test="jllx != null and jllx != ''">
and jllx = #{jllx}
</if>
<if test="jlId != null and jlId != ''">
and jl_id = #{jlId}
</if>
<if test="jlxm != null and jlxm != ''">
and jlxm = #{jlxm}
</if>
<if test="sfzh != null and sfzh != ''">
and sfzh = #{sfzh}
</if>
<if test="xbdm != null and xbdm != ''">
and xbdm = #{xbdm}
</if>
<if test="nl != null">
and nl = #{nl}
</if>
<if test="jlzt != null and jlzt != ''">
and jlzt = #{jlzt}
</if>
<if test="zblx != null and zblx != ''">
and zblx = #{zblx}
</if>
<if test="ssbm != null and ssbm != ''">
and ssbm = #{ssbm}
</if>
<if test="ssbmdm != null and ssbmdm != ''">
and ssbmdm = #{ssbmdm}
</if>
<if test="ssxgaj != null and ssxgaj != ''">
and ssxgaj = #{ssxgaj}
</if>
<if test="ssxgajdm != null and ssxgajdm != ''">
and ssxgajdm = #{ssxgajdm}
</if>
<if test="sssgaj != null and sssgaj != ''">
and sssgaj = #{sssgaj}
</if>
<if test="sssgajdm != null and sssgajdm != ''">
and sssgajdm = #{sssgajdm}
</if>
<if test="xtSjly != null and xtSjly != ''">
and xt_sjly = #{xtSjly}
</if>
<if test="xtSjzt != null and xtSjzt != ''">
and xt_sjzt = #{xtSjzt}
</if>
<if test="xtScbz != null and xtScbz != ''">
and xt_scbz = #{xtScbz}
</if>
<if test="xtCjip != null and xtCjip != ''">
and xt_cjip = #{xtCjip}
</if>
<if test="xtCjsj != null">
and xt_cjsj = #{xtCjsj}
</if>
<if test="xtCjrId != null and xtCjrId != ''">
and xt_cjr_id = #{xtCjrId}
</if>
<if test="xtCjr != null and xtCjr != ''">
and xt_cjr = #{xtCjr}
</if>
<if test="xtCjbmdm != null and xtCjbmdm != ''">
and xt_cjbmdm = #{xtCjbmdm}
</if>
<if test="xtCjbmmc != null and xtCjbmmc != ''">
and xt_cjbmmc = #{xtCjbmmc}
</if>
<if test="xtZhgxip != null and xtZhgxip != ''">
and xt_zhgxip = #{xtZhgxip}
</if>
<if test="xtZhgxsj != null">
and xt_zhgxsj = #{xtZhgxsj}
</if>
<if test="xtZhgxrid != null and xtZhgxrid != ''">
and xt_zhgxrid = #{xtZhgxrid}
</if>
<if test="xtZhgxr != null and xtZhgxr != ''">
and xt_zhgxr = #{xtZhgxr}
</if>
<if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
and xt_zhgxbmdm = #{xtZhgxbmdm}
</if>
<if test="xtZhgxbm != null and xtZhgxbm != ''">
and xt_zhgxbm = #{xtZhgxbm}
</if>
<if test="bz != null and bz != ''">
and bz = #{bz}
</if>
</where>
</select>
<select id="countReportPolice" resultType="Map">
select count(*) bb, zblx
from tb_qw_jl
where zblx is not null
and xt_sjzt = '1'
and DATE_FORMAT(xt_cjsj, '%Y-%m-%d') = DATE_FORMAT(now(), '%Y-%m-%d')
${sql}
GROUP BY zblx
</select>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_qw_jl(id, ywid, jllx, jl_id, jlxm, sfzh, xbdm, nl, jlzt, zblx, ssbm, ssbmdm, ssxgaj, ssxgajdm,
sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz, xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc,
xt_zhgxip, xt_zhgxsj, xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.ywid}, #{entity.jllx}, #{entity.jlId}, #{entity.jlxm}, #{entity.sfzh}, #{entity.xbdm},
#{entity.nl}, #{entity.jlzt}, #{entity.zblx}, #{entity.ssbm}, #{entity.ssbmdm}, #{entity.ssxgaj},
#{entity.ssxgajdm}, #{entity.sssgaj}, #{entity.sssgajdm}, #{entity.xtSjly}, #{entity.xtSjzt},
#{entity.xtScbz}, #{entity.xtCjip}, #{entity.xtCjsj}, #{entity.xtCjrId}, #{entity.xtCjr},
#{entity.xtCjbmdm}, #{entity.xtCjbmmc}, #{entity.xtZhgxip}, #{entity.xtZhgxsj}, #{entity.xtZhgxrid},
#{entity.xtZhgxr}, #{entity.xtZhgxbmdm}, #{entity.xtZhgxbm}, #{entity.bz})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_qw_jl(ywid, jllx, jl_id, jlxm, sfzh, xbdm, nl, jlzt, zblx, ssbm, ssbmdm, ssxgaj, ssxgajdm,
sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz, xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc,
xt_zhgxip, xt_zhgxsj, xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.ywid}, #{entity.jllx}, #{entity.jlId}, #{entity.jlxm}, #{entity.sfzh}, #{entity.xbdm},
#{entity.nl}, #{entity.jlzt}, #{entity.zblx}, #{entity.ssbm}, #{entity.ssbmdm}, #{entity.ssxgaj},
#{entity.ssxgajdm}, #{entity.sssgaj}, #{entity.sssgajdm}, #{entity.xtSjly}, #{entity.xtSjzt},
#{entity.xtScbz}, #{entity.xtCjip}, #{entity.xtCjsj}, #{entity.xtCjrId}, #{entity.xtCjr},
#{entity.xtCjbmdm}, #{entity.xtCjbmmc}, #{entity.xtZhgxip}, #{entity.xtZhgxsj}, #{entity.xtZhgxrid},
#{entity.xtZhgxr}, #{entity.xtZhgxbmdm}, #{entity.xtZhgxbm}, #{entity.bz})
</foreach>
on duplicate key update
ywid = values(ywid),
jllx = values(jllx),
jl_id = values(jl_id),
jlxm = values(jlxm),
sfzh = values(sfzh),
xbdm = values(xbdm),
nl = values(nl),
jlzt = values(jlzt),
zblx = values(zblx),
ssbm = values(ssbm),
ssbmdm = values(ssbmdm),
ssxgaj = values(ssxgaj),
ssxgajdm = values(ssxgajdm),
sssgaj = values(sssgaj),
sssgajdm = values(sssgajdm),
xt_sjly = values(xt_sjly),
xt_sjzt = values(xt_sjzt),
xt_scbz = values(xt_scbz),
xt_cjip = values(xt_cjip),
xt_cjsj = values(xt_cjsj),
xt_cjr_id = values(xt_cjr_id),
xt_cjr = values(xt_cjr),
xt_cjbmdm = values(xt_cjbmdm),
xt_cjbmmc = values(xt_cjbmmc),
xt_zhgxip = values(xt_zhgxip),
xt_zhgxsj = values(xt_zhgxsj),
xt_zhgxrid = values(xt_zhgxrid),
xt_zhgxr = values(xt_zhgxr),
xt_zhgxbmdm = values(xt_zhgxbmdm),
xt_zhgxbm = values(xt_zhgxbm),
bz = values(bz)
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_qw_jl
<set>
<if test="ywid != null and ywid != ''">
ywid = #{ywid},
</if>
<if test="jllx != null and jllx != ''">
jllx = #{jllx},
</if>
<if test="jlId != null and jlId != ''">
jl_id = #{jlId},
</if>
<if test="jlxm != null and jlxm != ''">
jlxm = #{jlxm},
</if>
<if test="sfzh != null and sfzh != ''">
sfzh = #{sfzh},
</if>
<if test="xbdm != null and xbdm != ''">
xbdm = #{xbdm},
</if>
<if test="nl != null">
nl = #{nl},
</if>
<if test="jlzt != null and jlzt != ''">
jlzt = #{jlzt},
</if>
<if test="zblx != null and zblx != ''">
zblx = #{zblx},
</if>
<if test="ssbm != null and ssbm != ''">
ssbm = #{ssbm},
</if>
<if test="ssbmdm != null and ssbmdm != ''">
ssbmdm = #{ssbmdm},
</if>
<if test="ssxgaj != null and ssxgaj != ''">
ssxgaj = #{ssxgaj},
</if>
<if test="ssxgajdm != null and ssxgajdm != ''">
ssxgajdm = #{ssxgajdm},
</if>
<if test="sssgaj != null and sssgaj != ''">
sssgaj = #{sssgaj},
</if>
<if test="sssgajdm != null and sssgajdm != ''">
sssgajdm = #{sssgajdm},
</if>
<if test="xtSjly != null and xtSjly != ''">
xt_sjly = #{xtSjly},
</if>
<if test="xtSjzt != null and xtSjzt != ''">
xt_sjzt = #{xtSjzt},
</if>
<if test="xtScbz != null and xtScbz != ''">
xt_scbz = #{xtScbz},
</if>
<if test="xtCjip != null and xtCjip != ''">
xt_cjip = #{xtCjip},
</if>
<if test="xtCjsj != null">
xt_cjsj = #{xtCjsj},
</if>
<if test="xtCjrId != null and xtCjrId != ''">
xt_cjr_id = #{xtCjrId},
</if>
<if test="xtCjr != null and xtCjr != ''">
xt_cjr = #{xtCjr},
</if>
<if test="xtCjbmdm != null and xtCjbmdm != ''">
xt_cjbmdm = #{xtCjbmdm},
</if>
<if test="xtCjbmmc != null and xtCjbmmc != ''">
xt_cjbmmc = #{xtCjbmmc},
</if>
<if test="xtZhgxip != null and xtZhgxip != ''">
xt_zhgxip = #{xtZhgxip},
</if>
<if test="xtZhgxsj != null">
xt_zhgxsj = #{xtZhgxsj},
</if>
<if test="xtZhgxrid != null and xtZhgxrid != ''">
xt_zhgxrid = #{xtZhgxrid},
</if>
<if test="xtZhgxr != null and xtZhgxr != ''">
xt_zhgxr = #{xtZhgxr},
</if>
<if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
xt_zhgxbmdm = #{xtZhgxbmdm},
</if>
<if test="xtZhgxbm != null and xtZhgxbm != ''">
xt_zhgxbm = #{xtZhgxbm},
</if>
<if test="bz != null and bz != ''">
bz = #{bz},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<update id="deleteById">
</update>
<update id="deleteByYwid">
delete
from tb_qw_jl
where ywid = #{ywid}
</update>
<select id="queryListByYwid" resultType="com.mosty.base.model.entity.qwzx.TbQwJl">
select a.* from tb_qw_jl a
where a.xt_scbz = '0'
and a.ywid in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<!--查询今日报备警力数量-->
<select id="getCount" resultType="Integer" parameterType="Map">
select count(1) from tb_qw_jl a where a.xt_scbz = '0' and a.xt_sjzt = '1'
and a.zblx = '3'
<if test="dto.jllx != null and dto.jllx != ''">
and a.jllx = #{dto.jllx}
</if>
<if test="dto.jlxm != null and dto.jlxm != ''">
and a.jlxm like concat('%',#{dto.jlxm},'%')
</if>
and a.ywid in (
select id from tb_qw_xfbb b where b.xt_scbz = '0' and b.xt_sjzt = '1' and b.bbzt = '0'
<if test="dto.xfbmdm != null and dto.xfbmdm != ''">
and b.xfbmdm like concat(#{dto.xfbmdm},'%')
</if>
)
</select>
<!--查询今日报备警力集合-->
<select id="getList" resultMap="TbQwJlMap" parameterType="Map">
select * from tb_qw_jl a where a.xt_scbz = '0' and a.xt_sjzt = '1'
and a.zblx = '3'
<if test="dto.jllx != null and dto.jllx != ''">
and a.jllx = #{dto.jllx}
</if>
<if test="dto.jlxm != null and dto.jlxm != ''">
and a.jlxm like concat('%',#{dto.jlxm},'%')
</if>
and a.ywid in (
select id from tb_qw_xfbb b where b.xt_scbz = '0' and b.xt_sjzt = '1' and b.bbzt = '0'
<if test="dto.xfbmdm != null and dto.xfbmdm != ''">
and b.xfbmdm like concat(#{dto.xfbmdm},'%')
</if>
<!-- ${useSql}-->
)
limit #{pageIndex},#{pageSize}
</select>
</mapper>

View File

@ -0,0 +1,27 @@
<?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.mosty.qwzx.mapper.TbQwJyqxMapper">
<!--根据ID删除警用器械明细-->
<update id="deleteJyqx">
update tb_qw_jyqx set xt_scbz = '1' where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<!--根据业务ID删除明细-->
<delete id="deleteByYwid">
delete from tb_qw_jyqx where ywid = #{ywid}
</delete>
<select id="queryListByYwid" resultType="com.mosty.base.model.entity.qwzx.TbQwJyqx">
select a.* from tb_qw_jyqx a
where a.xt_scbz = '0'
and a.ywid in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

View File

@ -0,0 +1,12 @@
<?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.mosty.qwzx.mapper.TbQwQwbcMapper">
<delete id="deleteQwbc">
delete from tb_qw_qwbc where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,18 @@
<?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.mosty.qwzx.mapper.TbQwQwdjMapper">
<delete id="deleteQwdj">
delete from tb_qw_qwdj where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<select id="queryCurrentQwdj" resultType="com.mosty.base.model.entity.qwzx.TbQwQwdj">
SELECT * FROM tb_qw_qwdj where xt_scbz = '0' and fbzt = '1'
and date_format(#{datetime},'%Y-%m-%d %H:%i:%s') BETWEEN qwkssj and qwjssj order by qwdj LIMIT 1
</select>
</mapper>

View File

@ -0,0 +1,17 @@
<?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.mosty.qwzx.mapper.TbQwQxjMapper">
<update id="deleteQxj">
update tb_qw_qxj set xt_scbz = '1' where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<select id="selectHolidayCount" resultType="java.util.Map">
select count(*),sqrlx from tb_qw_qxj where DATE_FORMAT(now(),'%Y-%m-%d')
between kssj and jssj GROUP BY sqrlx
</select>
</mapper>

View File

@ -0,0 +1,5 @@
<?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.mosty.qwzx.mapper.TbQwSpsCsdwMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?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.mosty.qwzx.mapper.TbQwSpsCsdwhdgjMapper">
</mapper>

View File

@ -0,0 +1,12 @@
<?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.mosty.qwzx.mapper.TbQwXfBxfsqMapper">
<delete id="deleteBxfsq">
delete from tb_qw_xf_bxfsq where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,838 @@
<?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.mosty.qwzx.mapper.TbQwXfbbMapper">
<resultMap id="BaseResultMap" type="com.mosty.base.model.dto.qwzx.TbQwXfbbVo">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="xfpb_id" property="xfpbId"/>
<result column="bblx" property="bblx"/>
<result column="qwlx" property="qwlx"/>
<result column="qwdj_id" property="qwdjId"/>
<result column="qwdj" property="qwdj"/>
<result column="qwbc_id" property="qwbcId"/>
<result column="jz_id" property="jzId"/>
<result column="jz_mc" property="jzMc"/>
<result column="xfbm" property="xfbm"/>
<result column="xfbmid" property="xfbmid"/>
<result column="xfbmdm" property="xfbmdm"/>
<result column="fzr_sfzh" property="fzrSfzh"/>
<result column="fzr_xm" property="fzrXm"/>
<result column="fzr_id" property="fzrId"/>
<result column="fzr_lxdh" property="fzrLxdh"/>
<result column="xfrq" property="xfrq"/>
<result column="kssj" property="kssj"/>
<result column="jssj" property="jssj"/>
<result column="zqsc" property="zqsc"/>
<result column="jgts" property="jgts"/>
<result column="mjsl" property="mjsl"/>
<result column="pbmj" property="pbmj"/>
<result column="fjsl" property="fjsl"/>
<result column="pbfj" property="pbfj"/>
<result column="jcsl" property="jcsl"/>
<result column="pbcl" property="pbcl"/>
<result column="txzbsl" property="txzbsl"/>
<result column="txzb" property="txzb"/>
<result column="jyqxsl" property="jyqxsl"/>
<result column="jyqx" property="jyqx"/>
<result column="wzlx" property="wzlx"/>
<result column="zzlx" property="zzlx"/>
<result column="xlfs" property="xlfs"/>
<result column="xfzt" property="xfzt"/>
<result column="bbkssj" property="bbkssj"/>
<result column="bbjssj" property="bbjssj"/>
<result column="bbzt" property="bbzt"/>
<result column="dqwz" property="dqwz"/>
<result column="jd" property="jd"/>
<result column="wd" property="wd"/>
<result column="zbhash" property="zbhash"/>
<result column="zbsj" property="zbsj"/>
<result column="xfsc" property="xfsc"/>
<result column="xflc" property="xflc"/>
<result column="xffwlx" property="xffwlx"/>
<result column="xffwid" property="xffwid"/>
<result column="ssbm" property="ssbm"/>
<result column="ssbmid" property="ssbmid"/>
<result column="ssbmdm" property="ssbmdm"/>
<result column="ssxgaj" property="ssxgaj"/>
<result column="ssxgajid" property="ssxgajid"/>
<result column="ssxgajdm" property="ssxgajdm"/>
<result column="sssgajid" property="sssgajid"/>
<result column="sssgaj" property="sssgaj"/>
<result column="sssgajdm" property="sssgajdm"/>
<result column="bz" property="bz"/>
<result column="zylx" property="zylx"/>
<result column="dzbq" property="dzbq"/>
<result column="wqzb" property="wqzb"/>
<collection property="jlList" ofType="com.mosty.base.model.dto.qwzx.TbQwJlDto">
<result column="id" property="id"/>
<result column="ywid" property="ywid"/>
<result column="jl_id" property="jlId"/>
<result column="jllx" property="jllx"/>
<result column="jlxm" property="jlxm"/>
<result column="xbdm" property="xbdm"/>
<result column="nl" property="nl"/>
<result column="jlzt" property="jlzt"/>
<result column="zblx" property="zblx"/>
</collection>
<collection property="clList" ofType="com.mosty.base.model.dto.qwzx.TbQwClDto">
<result column="id" property="id"/>
<result column="ywid" property="ywid"/>
<result column="qwcl_id" property="qwclId"/>
<result column="clmc" property="clmc"/>
<result column="jdchphm" property="jdchphm"/>
<result column="jdchpzldm" property="jdchpzldm"/>
<result column="zblx" property="zblx"/>
</collection>
<collection property="znzbList" ofType="com.mosty.base.model.dto.qwzx.TbQwZnzbDto">
<result column="id" property="id"/>
<result column="ywid" property="ywid"/>
<result column="txzb_id" property="txzbId"/>
<result column="sbmc" property="sbmc"/>
<result column="txzblx" property="txzblx"/>
<result column="hh" property="hh"/>
<result column="zhh" property="zhh"/>
<result column="zblx" property="zblx"/>
</collection>
<collection property="jyqxList" ofType="com.mosty.base.model.dto.qwzx.TbQwJyqxDto">
<result column="id" property="id"/>
<result column="ywid" property="ywid"/>
<result column="zblx" property="zblx"/>
<result column="qxmc" property="qxmc"/>
<result column="qxlx" property="qxlx"/>
<result column="qxsl" property="qxsl"/>
</collection>
</resultMap>
<resultMap id="BaseMap" type="com.mosty.base.model.entity.qwzx.TbQwXfbb">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="xfpb_id" property="xfpbId"/>
<result column="qwdj_id" property="qwdjId"/>
<result column="qwlx" property="qwlx"/>
<result column="bblx" property="bblx"/>
<result column="qwdj" property="qwdj"/>
<result column="qwbc_id" property="qwbcId"/>
<result column="jz_id" property="jzId"/>
<result column="jz_mc" property="jzMc"/>
<result column="xfbm" property="xfbm"/>
<result column="xfbmid" property="xfbmid"/>
<result column="xfbmdm" property="xfbmdm"/>
<result column="fzr_sfzh" property="fzrSfzh"/>
<result column="fzr_xm" property="fzrXm"/>
<result column="fzr_id" property="fzrId"/>
<result column="fzr_lxdh" property="fzrLxdh"/>
<result column="xfrq" property="xfrq"/>
<result column="kssj" property="kssj"/>
<result column="jssj" property="jssj"/>
<result column="zqsc" property="zqsc"/>
<result column="jgts" property="jgts"/>
<result column="mjsl" property="mjsl"/>
<result column="pbmj" property="pbmj"/>
<result column="fjsl" property="fjsl"/>
<result column="pbfj" property="pbfj"/>
<result column="jcsl" property="jcsl"/>
<result column="pbcl" property="pbcl"/>
<result column="txzbsl" property="txzbsl"/>
<result column="txzb" property="txzb"/>
<result column="jyqxsl" property="jyqxsl"/>
<result column="jyqx" property="jyqx"/>
<result column="wzlx" property="wzlx"/>
<result column="zzlx" property="zzlx"/>
<result column="xlfs" property="xlfs"/>
<result column="xfzt" property="xfzt"/>
<result column="bbkssj" property="bbkssj"/>
<result column="bbjssj" property="bbjssj"/>
<result column="bbzt" property="bbzt"/>
<result column="dqwz" property="dqwz"/>
<result column="jd" property="jd"/>
<result column="wd" property="wd"/>
<result column="zb" property="zb" typeHandler="com.mosty.base.feign.handle.PointTypeHandler"/>
<result column="zbhash" property="zbhash"/>
<result column="zbsj" property="zbsj"/>
<result column="xfsc" property="xfsc"/>
<result column="xflc" property="xflc"/>
<result column="xffwlx" property="xffwlx"/>
<result column="xffwid" property="xffwid"/>
<result column="ssbm" property="ssbm"/>
<result column="ssbmid" property="ssbmid"/>
<result column="ssbmdm" property="ssbmdm"/>
<result column="ssxgaj" property="ssxgaj"/>
<result column="ssxgajid" property="ssxgajid"/>
<result column="ssxgajdm" property="ssxgajdm"/>
<result column="sssgajid" property="sssgajid"/>
<result column="sssgaj" property="sssgaj"/>
<result column="sssgajdm" property="sssgajdm"/>
<result property="xtSjly" column="xt_sjly" jdbcType="VARCHAR"/>
<result property="xtSjzt" column="xt_sjzt" jdbcType="VARCHAR"/>
<result property="xtScbz" column="xt_scbz" jdbcType="VARCHAR"/>
<result property="xtCjip" column="xt_cjip" jdbcType="VARCHAR"/>
<result property="xtCjsj" column="xt_cjsj" jdbcType="VARCHAR"/>
<result property="xtCjrId" column="xt_cjr_id" jdbcType="VARCHAR"/>
<result property="xtCjr" column="xt_cjr" jdbcType="VARCHAR"/>
<result property="xtCjbmdm" column="xt_cjbmdm" jdbcType="VARCHAR"/>
<result property="xtCjbmmc" column="xt_cjbmmc" jdbcType="VARCHAR"/>
<result property="xtZhgxip" column="xt_zhgxip" jdbcType="VARCHAR"/>
<result property="xtZhgxsj" column="xt_zhgxsj" jdbcType="VARCHAR"/>
<result property="xtZhgxrid" column="xt_zhgxrid" jdbcType="VARCHAR"/>
<result property="xtZhgxr" column="xt_zhgxr" jdbcType="VARCHAR"/>
<result property="xtZhgxbmdm" column="xt_zhgxbmdm" jdbcType="VARCHAR"/>
<result property="xtZhgxbm" column="xt_zhgxbm" jdbcType="VARCHAR"/>
<result column="bz" property="bz"/>
<result column="zylx" property="zylx"/>
<result column="dzbq" property="dzbq"/>
<result column="wqzb" property="wqzb"/>
</resultMap>
<!--查询-->
<select id="queryList" resultMap="BaseResultMap">
select a.*,b.*,c.*,d.*,e.* from tb_qw_xfbb a
left join tb_qw_jl b on a.id = b.ywid
left join tb_qw_cl c on a.id = c.ywid
left join tb_qw_znzb d on a.id = d.ywid
left join tb_qw_jyqx e on a.id = e.ywid
where a.xt_scbz = '0'
<if test="params.xfbId != null and params.xfbId != ''">
and a.xfpb_id = #{params.xfpbId,jdbcType=VARCHAR}
</if>
<if test="params.qwdjId != null and params.qwdjId != ''">
and a.qwdj_id = #{params.qwdjId,jdbcType=VARCHAR}
</if>
<if test="params.qwbcId != null and params.qwbcId != ''">
and a.qwbc_id = #{params.qwbcId,jdbcType=VARCHAR}
</if>
<if test="params.jzId != null and params.jzId != ''">
and a.jz_id = #{params.jzId,jdbcType=VARCHAR}
</if>
<if test="params.qwdj != null and params.qwdj != ''">
and a.qwdj = #{params.qwdj,jdbcType=VARCHAR}
</if>
<if test="params.xfbmdm != null and params.xfbmdm != ''">
and a.xfbmdm = #{params.xfbmdm,jdbcType=VARCHAR}
</if>
<if test="params.fzrXm != null and params.fzrXm != ''">
and a.fzr_xm like concat('%',#{params.fzrXm,jdbcType=VARCHAR},'%')
</if>
<if test="params.fzrSfzh != null and params.fzrSfzh != ''">
and a.fzr_sfzh like concat('%',#{params.fzrSfzh,jdbcType=VARCHAR},'%')
</if>
<if test="params.xfzt != null and params.xfzt != ''">
and a.xfzt = #{params.xfzt,jdbcType=VARCHAR}
</if>
<if test="params.xtSjly != null and params.xtSjly != ''">
and a.xt_sjly = #{params.xtSjly,jdbcType=VARCHAR}
</if>
<if test="params.xtSjzt != null and params.xtSjzt != ''">
and a.xt_sjzt = #{params.xtSjzt,jdbcType=VARCHAR}
</if>
<if test="params.kssj != null and params.jssj == null">
and a.kssj &gt;= #{params.kssj,jdbcType=DATE}
</if>
<if test="params.kssj == null and params.jssj != null">
and a.kssj &lt;= #{params.jssj,jdbcType=DATE}
</if>
<if test="params.kssj != null and params.jssj != null">
and a.kssj between #{params.kssj,jdbcType=DATE} and #{params.jssj,jdbcType=DATE}
</if>
<if test="params.ssbmdm != null and params.ssbmdm != ''">
and a.ssbmdm like concat(#{params.ssbmdm},'%')
</if>
<!-- 数据范围过滤 -->
<!-- ${createSql}-->
</select>
<!--id查询-->
<select id="queryById" resultMap="BaseResultMap">
select a.*, b.*, c.*, d.*, e.*
from tb_qw_xfbb a
left join tb_qw_jl b on a.id = b.ywid
left join tb_qw_cl c on a.id = c.ywid
left join tb_qw_znzb d on a.id = d.ywid
left join tb_qw_jyqx e on a.id = e.ywid
where a.xt_scbz = '0'
and a.id = #{id,jdbcType=VARCHAR}
</select>
<select id="selectJhsl" resultType="Integer">
select count(1) from tb_qw_xfpb_zq b where b.xt_scbz = '0' and b.xt_sjzt = '1'
and b.id in (select a.pbzq_id from tb_qw_xfpb_mrjl a where DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%s')
between DATE_FORMAT(a.xfkssj, '%Y-%m-%d %H:%i:%s') and DATE_FORMAT(a.xfjssj, '%Y-%m-%d %H:%i:%s'))
<if test="dto != null and dto.fzrXm != null and dto.fzrXm != ''">
and b.fzr_xm like concat ('%',#{dto.fzrXm},'%')
</if>
<!-- <if test="dto != null and dto.ssbmid != null and dto.ssbmid != ''">-->
<!-- and b.ssbmid = #{dto.ssbmid}-->
<!-- </if>-->
<if test="dto != null and dto.ssbmdm != null and dto.ssbmdm != ''">
and b.ssbmdm like concat(#{dto.ssbmdm},'%')
</if>
<!-- ${useSql}-->
</select>
<select id="selectJhslList" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpbZq">
select * from tb_qw_xfpb_zq b where b.xt_scbz = '0' and b.xt_sjzt = '1'
and b.id in (select a.pbzq_id from tb_qw_xfpb_mrjl a where DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%s')
between DATE_FORMAT(a.xfkssj, '%Y-%m-%d %H:%i:%s') and DATE_FORMAT(a.xfjssj, '%Y-%m-%d %H:%i:%s')
)
<if test="dto != null and dto.fzrXm != null and dto.fzrXm != ''">
and b.fzr_xm like concat ('%',#{dto.fzrXm},'%')
</if>
<!-- <if test="dto != null and dto.ssbmid != null and dto.ssbmid != ''">-->
<!-- and b.ssbmid = #{dto.ssbmid}-->
<!-- </if>-->
<if test="dto != null and dto.ssbmdm != null and dto.ssbmdm != ''">
and b.ssbmdm = #{dto.ssbmdm}
</if>
<!-- ${useSql}-->
limit #{pageIndex}, #{pageSize}
</select>
<select id="selectSjsl" resultType="Integer">
select count(1)
from tb_qw_xfbb b
where b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.bbzt = '0'
<if test="dto != null and dto.fzrXm != null and dto.fzrXm != ''">
and b.fzr_xm like concat ('%',#{dto.fzrXm},'%')
</if>
<!-- <if test="dto != null and dto.ssbmid != null and dto.ssbmid != ''">-->
<!-- and b.xfbmdm = #{dto.ssbmid}-->
<!-- </if>-->
<if test="dto != null and dto.ssbmdm != null and dto.ssbmdm != ''">
and b.ssbmdm like concat(#{dto.ssbmdm},'%')
</if>
<!-- ${useSql}-->
</select>
<select id="selectSjslList" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
select *
from tb_qw_xfbb b
where b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.bbzt = '0'
<if test="dto != null and dto.fzrXm != null and dto.fzrXm != ''">
and b.fzr_xm like concat ('%',#{dto.fzrXm},'%')
</if>
<!-- <if test="dto != null and dto.ssbmid != null and dto.ssbmid != ''">-->
<!-- and b.xfbmdm = #{dto.ssbmid}-->
<!-- </if>-->
<if test="dto != null and dto.ssbmdm != null and dto.ssbmdm != ''">
and b.ssbmdm like concat(#{dto.ssbmdm},'%')
</if>
<!-- ${useSql}-->
limit #{pageIndex}
, #{pageSize}
</select>
<select id="selectPowerAndDayLength" resultType="java.util.Map" parameterType="String">
select ifnull(sum(mjsl), 0) jmmjsl,
ifnull(sum(fjsl), 0) jmfjsl,
ifnull(sum(xfsc), 0) xfsc,
ifnull(sum(xflc), 0) xflc
from tb_qw_xfbb
where xt_scbz = '0'
and xt_sjzt = '1'
and bbzt = '0'
<if test="ssbmdm != null and ssbmdm != ''">
and ssbmdm like concat(#{ssbmdm},'%')
</if>
</select>
<select id="selectNearbyDeck" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
SELECT *,
(
6371 * acos(
cos(radians(#{t.jd}))
* cos(radians(jd))
* cos(radians(wd) - radians(#{t.wd}))
+ sin(radians(#{t.jd}))
* sin(radians(jd))
)
)
AS distance
FROM tb_qw_xfbb
HAVING distance &lt; 20
ORDER BY distance;
</select>
<!--批量删除-->
<update id="deleteXfbb">
update tb_qw_xfbb set xt_scbz = '1' where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<!--查询周边巡组或街面巡组数量-->
<select id="getCountZbxz" resultType="Integer" parameterType="Map">
select count(1) from tb_qw_xfbb a where a.xt_scbz = '0' and a.xt_sjzt = '1' and a.bbzt= '0'
<if test="dto.jd != null and dto.wd != null and dto.radius != null">
<![CDATA[and st_distance_sphere(POINT(jd,wd),POINT(#{dto.jd},#{dto.wd})) <= #{dto.radius}]]>
</if>
<!-- <if test="list != null and list.size() > 0 and qwList != null and qwList.size() > 0 ">
and a.xfzt in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>-->
<choose>
<when test="list != null and list.size() > 0 and qwList != null and qwList.size() > 0 ">
and ( a.xfzt in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
or a.qwlx in
<foreach collection="qwList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
)
</when>
<when test="list != null and list.size() > 0 ">
and a.xfzt in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</when>
<when test="qwList != null and qwList.size() > 0 ">
and a.qwlx in
<foreach collection="qwList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</when>
</choose>
<if test="dto.bbrq != null and dto.bbrq != ''">
and date_format(a.xfrq,'%Y-%m-%d') = #{dto.bbrq}
</if>
<if test="dto.zzlx != null and dto.zzlx != ''">
and a.zzlx = #{dto.zzlx}
</if>
<if test="dto.fzrXm != null and dto.fzrXm != ''">
and a.fzr_xm like concat('%',#{dto.fzrXm},'%')
</if>
<if test="dto.jzMc != null and dto.jzMc != ''">
and a.jz_mc like concat('%',#{dto.jzMc},'%')
</if>
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
and a.ssbmdm like concat(#{dto.ssbmdm},'%')
</if>
<if test="dto.keyword != null and dto.keyword != ''">
and (
a.xfbm like concat('%',#{dto.keyword},'%') or
a.jz_mc like concat('%',#{dto.keyword},'%') or
a.fzr_xm like concat('%',#{dto.keyword},'%') or
a.dqwz like concat('%',#{dto.keyword},'%')
)
</if>
<!-- <if test="qwList != null and qwList.size() > 0">
and a.qwlx in
<foreach collection="qwList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
-->
</select>
<!--查询周边巡组或街面巡组列表-->
<select id="getListZbxz" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb" parameterType="Map">
select *
<if test="dto.jd != null and dto.wd != null and dto.radius != null">
,st_distance_sphere(POINT(jd,wd),POINT(#{dto.jd},#{dto.wd})) as distance
</if>
from tb_qw_xfbb a where a.xt_scbz = '0' and a.xt_sjzt = '1' and a.bbzt= '0'
<!-- <if test="list != null and list.size() > 0">
and a.xfzt in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>-->
<choose>
<when test="list != null and list.size() > 0 and qwList != null and qwList.size() > 0 ">
and ( a.xfzt in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
or a.qwlx in
<foreach collection="qwList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
)
</when>
<when test="list != null and list.size() > 0 ">
and a.xfzt in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</when>
<when test="qwList != null and qwList.size() > 0 ">
and a.qwlx in
<foreach collection="qwList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</when>
</choose>
<if test="dto.bbrq != null and dto.bbrq != ''">
and date_format(a.xfrq,'%Y-%m-%d') = #{dto.bbrq}
</if>
<if test="dto.zzlx != null and dto.zzlx != ''">
and a.zzlx = #{dto.zzlx}
</if>
<!-- <if test="dto.ssbmdm != null and dto.ssbmdm != ''">-->
<!-- and ssbmdm = #{dto.ssbmdm}-->
<!-- </if>-->
<if test="dto.fzrXm != null and dto.fzrXm != ''">
and a.fzr_xm like concat('%',#{dto.fzrXm},'%')
</if>
<if test="dto.jzMc != null and dto.jzMc != ''">
and a.jz_mc like concat('%',#{dto.jzMc},'%')
</if>
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
and a.ssbmdm like concat(#{dto.ssbmdm},'%')
</if>
<if test="dto.keyword != null and dto.keyword != ''">
and (
a.xfbm like concat('%',#{dto.keyword},'%') or
a.jz_mc like concat('%',#{dto.keyword},'%') or
a.fzr_xm like concat('%',#{dto.keyword},'%') or
a.dqwz like concat('%',#{dto.keyword},'%')
)
</if>
<!-- <if test="qwList != null and qwList.size() > 0">
and a.qwlx in
<foreach collection="qwList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>-->
<if test="dto.jd != null and dto.wd != null and dto.radius != null">
<![CDATA[and st_distance_sphere(POINT(jd,wd),POINT(#{dto.jd},#{dto.wd})) <= #{dto.radius}]]>
order by distance asc
</if>
<if test="pageIndex != null and pageIndex != null and pageIndex != '' and pageSize != ''">
limit #{pageIndex},#{pageSize}
</if>
</select>
<!--查询我今天的报备-->
<select id="getMybbTodayNew" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb" parameterType="String">
select *
from tb_qw_xfbb a
where a.xt_scbz = '0'
<if test="bblx != null and bblx != ''">
and a.bblx = #{bblx}
</if>
and a.xt_sjzt = '1'
and a.bbzt = '0'
and a.bbjssj is null
and (
a.fzr_sfzh = #{sfzh} or a.id in (select ywid
from tb_qw_jl b
where b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.ywid = a.id
and b.sfzh = #{sfzh})
)
limit 1
</select>
<!--查询我今天的报备-->
<select id="getMybbTodayByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb" parameterType="String">
select *
from tb_qw_xfbb a
where a.xt_scbz = '0'
and a.xt_sjzt = '1'
and a.bbzt = '0'
and a.bbjssj is null
<if test="bblx != null and bblx != ''">
and a.bblx = #{bblx}
</if>
<if test="time != null and time != ''">
and date_format(a.xfrq,'%Y-%m-%d') = #{time}
</if>
and (
a.fzr_id = #{userId} or a.id in (select ywid
from tb_qw_jl b
where b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.ywid = a.id
and b.jl_id = #{userId})
)
</select>
<select id="getBbxxByJi" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
select *
from (
select id,
st_distance_sphere(POINT(jd, wd), POINt(#{jd}, #{wd}))
as jl,
ssbm,
ssbmid,
ssbmdm,
ssxgaj,
ssxgajid,
ssxgajdm,
sssgaj,
sssgajid,
sssgajdm
from tb_qw_xfbb
where xt_scbz = '0'
and bbzt = '0'
and xfzt = '0'
<if test="ssbmid != null and ssbmid != ''">
and (ssbmid = #{ssbmid} or ssxgajid = #{ssbmid} or sssgajid = #{ssbmid})
</if>
order by jl asc
) a
where a.jl &lt;= #{radius} limit 1
</select>
<select id="getBbList" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
select a.*
from tb_qw_xfbb a,
tb_qw_znzb b
where a.id = b.ywid
and b.xt_sjzt = '1'
and b.xt_scbz = '0'
and b.hh = #{sbid}
and a.bbzt = '0'
<!-- and date_format(xfrq, '%Y-%m-%d') = date_format(now(), '%Y-%m-%d')-->
</select>
<select id="getClBbList" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
SELECT
a.*
FROM
tb_qw_xfbb a,
tb_qw_cl b
WHERE
a.id = b.ywid
AND b.xt_sjzt = '1'
AND b.xt_scbz = '0'
AND b.gps_id = #{sbid}
AND a.bbzt = '0'
</select>
<sql id="base_column_list">
id, xfpb_id, qwdj_id, qwdj, qwbc_id, jz_id, jz_mc,bblx,qwlx,
xfbm,xfbmid, xfbmdm, fzr_sfzh, fzr_xm, fzr_id, fzr_lxdh, xfrq, kssj, jssj,
zqsc, jgts, mjsl, pbmj, fjsl, pbfj, jcsl, pbcl, txzbsl, txzb, jyqxsl,
jyqx, wzlx, zzlx, xlfs, xfzt, bbkssj, bbjssj, bbzt, dqwz, jd, wd,
zbhash, zbsj, xfsc, xflc, xffwlx, xffwid, ssbm, ssbmdm, ssxgaj, ssxgajdm,ssbmid,ssxgajid,sssgajid,
sssgaj, sssgajdm, bz, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm,zylx,dzbq,wqzb
</sql>
<sql id="zb_sql">
ST_ASWKT
(zb)
as zb
</sql>
<insert id="insertEntity">
insert into tb_qw_xfbb
(id, xfpb_id, qwdj_id, qwdj, qwbc_id, jz_id, jz_mc, bblx, qwlx,
xfbm, xfbmid, xfbmdm, fzr_sfzh, fzr_xm, fzr_id, fzr_lxdh, xfrq, kssj, jssj,
zqsc, jgts, mjsl, pbmj, fjsl, pbfj, jcsl, pbcl, txzbsl, txzb, jyqxsl,
jyqx, wzlx, zzlx, xlfs, xfzt, bbkssj, bbjssj, bbzt, dqwz, jd, wd, zb,
zbhash, zbsj, xfsc, xflc, xffwlx, xffwid, ssbm, ssbmdm, ssxgaj, ssxgajdm, ssbmid, ssxgajid, sssgajid,
sssgaj, sssgajdm, bz, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, zylx,dzbq,wqzb)
values (#{id}, #{xfpbId}, #{qwdjId}, #{qwdj}, #{qwbcId}, #{jzId}, #{jzMc}, #{bblx}, #{qwlx},
#{xfbm}, #{xfbmid}, #{xfbmdm}, #{fzrSfzh}, #{fzrXm}, #{fzrId}, #{fzrLxdh}, #{xfrq}, #{kssj}, #{jssj},
#{zqsc}, #{jgts}, #{mjsl}, #{pbmj}, #{fjsl}, #{pbfj}, #{jcsl}, #{pbcl}, #{txzbsl}, #{txzb}, #{jyqxsl},
#{jyqx}, #{wzlx}, #{zzlx}, #{xlfs}, #{xfzt}, #{bbkssj}, #{bbjssj}, #{bbzt}, #{dqwz}, #{jd}, #{wd},
ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.PointTypeHandler}),
#{zbhash}, #{zbsj}, #{xfsc}, #{xflc}, #{xffwlx}, #{xffwid}, #{ssbm}, #{ssbmdm}, #{ssxgaj},
#{ssxgajdm}, #{ssbmid}, #{ssxgajid}, #{sssgajid},
#{sssgaj}, #{sssgajdm}, #{bz}, #{xtSjly}, #{xtSjzt}, #{xtScbz}, #{xtCjip},
#{xtCjsj}, #{xtCjrId}, #{xtCjr}, #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip}, #{xtZhgxsj},
#{xtZhgxrid},
#{xtZhgxr}, #{xtZhgxbmdm}, #{xtZhgxbm}, #{zylx}, #{dzbq}, #{wqzb})
</insert>
<select id="getSumXfsc" resultType="java.util.Map">
select sum(xfsc) xfsc,ssxgaj,ssxgajid from tb_qw_xfbb where xfrq &lt;= #{jssj} and xfrq >= #{kssj}
and xt_sjzt = '1' and xt_scbz = '0'
group by ssxgaj,ssxgajid
</select>
<select id="getSumXflc" resultType="java.util.Map">
select sum(xflc) xflc,ssxgaj,ssxgajid from tb_qw_xfbb where xfrq &lt;= #{jssj} and xfrq >= #{kssj}
and xt_sjzt = '1' and xt_scbz = '0'
group by ssxgaj,ssxgajid
</select>
<select id="getBbAll" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
select * from tb_qw_xfbb where
xt_sjzt = '1' and xt_scbz = '0' and bbzt = '0'
</select>
<!--修改巡逻状态-->
<update id="updateByXlzt">
update tb_qw_xfbb set xfzt = #{xlzt} where id = #{id}
</update>
<!--修改巡逻时长-->
<update id="updateXfscById">
update tb_qw_xfbb set xfsc = #{xfsc} where id = #{id}
</update>
<select id="bmtj" resultType="java.util.Map">
SELECT ssbm,ssbmdm,
sum(xfsc) xfsc,
SUM(xflc) xflc,
COUNT(1) xfxz,
SUM( IFNULL( jcsl, 0 ) ) jcsl,
SUM( IFNULL( mjsl, 0 ) ) mjsl,
SUM( IFNULL( fjsl, 0 ) ) fjsl
FROM `tb_qw_xfbb`
where xt_sjzt = '1' and xt_scbz = '0'
<if test="params.ssbmdm != null and params.ssbmdm != ''">
and ssbmdm like concat(#{params.ssbmdm},'%')
</if>
<if test="params.kssj != null and params.kssj != ''">
and bbkssj >= #{params.kssj}
</if>
<if test="params.jssj != null and params.jssj != ''">
and bbkssj &lt;= #{params.jssj}
</if>
GROUP BY ssbm,ssbmdm ORDER BY ssbmdm
</select>
<select id="bmtjAll" resultType="java.util.Map">
SELECT
sum(xfsc) xfsc,
SUM(xflc) xflc,
COUNT(1) xfxz,
SUM( IFNULL( jcsl, 0 ) ) jcsl,
SUM( IFNULL( mjsl, 0 ) ) mjsl,
SUM( IFNULL( fjsl, 0 ) ) fjsl
FROM `tb_qw_xfbb`
where xt_sjzt = '1' and xt_scbz = '0'
<if test="ssbmdm != null and ssbmdm != ''">
and ssbmdm like concat(#{ssbmdm},'%')
</if>
<if test="kssj != null and kssj != ''">
and bbkssj >= #{kssj}
</if>
<if test="jssj != null and jssj != ''">
and bbkssj &lt;= #{jssj}
</if>
</select>
<select id="xqtj" resultType="java.util.Map">
SELECT
glbid,
fw_mc,
COUNT( b.id ) xfxz,
SUM( IFNULL( b.jcsl, 0 ) ) jcsl,
SUM( IFNULL( b.mjsl, 0 ) ) mjsl,
SUM( IFNULL( b.xflc, 0 ) ) xflc,
SUM( IFNULL( b.xfsc, 0 ) ) xfsc,
SUM( IFNULL( b.fjsl, 0 ) ) fjsl
FROM
`tb_qw_xffw` f
LEFT JOIN tb_qw_xfbb b ON b.id = f.ywid
WHERE
f.qwlx = '2'
AND f.xt_scbz = '0'
AND b.xt_scbz = '0'
<if test="params.ssbmdm != null and params.ssbmdm != ''">
and b.ssbmdm like concat(#{params.ssbmdm},'%')
</if>
<if test="params.kssj != null and params.kssj != ''">
and b.bbkssj >= #{params.kssj}
</if>
<if test="params.jssj != null and params.jssj != ''">
and b.bbkssj &lt;= #{params.jssj}
</if>
GROUP BY
glbid,
fw_mc
</select>
<select id="grtj" resultType="java.util.Map">
SELECT
fzr_sfzh,
fzr_xm,
SUM( xfsc ) xfsc,
SUM( xflc ) xflc,
SUM( IFNULL( jcsl, 0 ) ) jcsl,
SUM( IFNULL( mjsl, 0 ) ) mjsl,
SUM( IFNULL( fjsl, 0 ) ) fjsl
FROM
`tb_qw_xfbb`
where xt_sjzt = '1' and xt_scbz = '0'
<if test="params.ssbmdm != null and params.ssbmdm != ''">
and ssbmdm like concat(#{params.ssbmdm},'%')
</if>
<if test="params.kssj != null and params.kssj != ''">
and bbkssj >= #{params.kssj}
</if>
<if test="params.jssj != null and params.jssj != ''">
and bbkssj &lt;= #{params.jssj}
</if>
GROUP BY
fzr_sfzh,
fzr_xm
</select>
<select id="getBbidByXq" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
select id, xfpb_id, qwdj_id, qwdj, qwbc_id, jz_id, jz_mc,bblx,qwlx,
xfbm,xfbmid, xfbmdm, fzr_sfzh, fzr_xm, fzr_id, fzr_lxdh, xfrq, kssj, jssj,
zqsc, jgts, mjsl, pbmj, fjsl, pbfj, jcsl, pbcl, txzbsl, txzb, jyqxsl,
jyqx, wzlx, zzlx, xlfs, xfzt, bbkssj, bbjssj, bbzt, dqwz, jd, wd,
zbsj, xfsc, xflc, xffwlx, xffwid, ssbm, ssbmdm, ssxgaj, ssxgajdm,ssbmid,ssxgajid,sssgajid,
sssgaj, sssgajdm, bz, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm,zylx,dzbq,wqzb from tb_qw_xfbb where xt_sjzt = '1' and xt_scbz = '0' and bbzt = '0'
<if test="xqid != null and xqid != ''">
and xffwid like concat('%',#{xqid},'%')
</if>
</select>
<select id="getScLc" resultType="java.util.Map">
SELECT
IFNULL( SUM( xflc ), 0 )/1000 xflc,
IFNULL( SUM( xfsc ), 0 )/3600 xfsc
FROM `tb_qw_xfbb`
WHERE xt_sjzt = '1' and xt_scbz = '0' and bblx = '01'
<if test="ssbmdm != null and ssbmdm != ''">
and ssbmdm like concat(#{ssbmdm},'%')
</if>
<if test="time != null and time != ''">
and xfrq = #{time}
</if>
</select>
<select id="getBbgj" resultType="com.mosty.base.model.entity.wzzx.TbWzLswz">
SELECT id,jd,wd,dwsj FROM mosty_wzzx.tb_wz_lswz
where ywid = #{bbid}
ORDER BY dwsj ASC
</select>
</mapper>

View File

@ -0,0 +1,8 @@
<?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.mosty.qwzx.mapper.TbQwXffwMapper">
<delete id="deleteByYwid">
delete from tb_qw_xffw where ywid = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,107 @@
<?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.mosty.qwzx.mapper.TbQwXfpbMapper">
<!--根据条件按查询总数-->
<select id="getCount" resultType="Integer" parameterType="Map">
select count(1) from tb_qw_xfpb a where a.xt_scbz = '0' and a.xt_scbz = '0'
and a.id in (
select pb_id from tb_qw_xfpb_zq b where b.xt_scbz = '0' and b.xt_scbz = '0'
and (
b.fzr_id = #{ryid} or b.id in (
select ywid from tb_qw_jl c where c.xt_scbz = '0' and c.xt_scbz = '0' and jl_id = #{ryid}
)
)
)
<if test="dto.jsrqlx != null and dto.jsrqlx != ''">
and a.jsrqlx = #{dto.jsrqlx}
</if>
<if test="dto.xhlx != null and dto.xhlx != ''">
and a.xhlx = #{dto.xhlx}
</if>
<if test="dto.xhzq != null">
and a.xhzq = #{dto.xhzq}
</if>
<if test="dto.mrbc != null">
and a.mrbc = #{dto.mrbc}
</if>
<if test="dto.pbksrq != null and dto.pbjsrq != null">
and (
a.pbksrq between #{dto.pbksrq} and #{dto.pbjsrq} or
a.pbjsrq between #{dto.pbksrq} and #{dto.pbjsrq}
)
</if>
</select>
<!--根据条件按查询总数-->
<select id="getList" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpb" parameterType="Map">
select a.* from tb_qw_xfpb a where a.xt_scbz = '0' and a.xt_scbz = '0'
and a.id in (
select pb_id from tb_qw_xfpb_zq b where b.xt_scbz = '0' and b.xt_scbz = '0'
and (
b.fzr_id = #{ryid} or b.id in (
select ywid from tb_qw_jl c where c.xt_scbz = '0' and c.xt_scbz = '0' and jl_id = #{ryid}
)
)
)
<if test="dto.jsrqlx != null and dto.jsrqlx != ''">
and a.jsrqlx = #{dto.jsrqlx}
</if>
<if test="dto.xhlx != null and dto.xhlx != ''">
and a.xhlx = #{dto.xhlx}
</if>
<if test="dto.xhzq != null">
and a.xhzq = #{dto.xhzq}
</if>
<if test="dto.mrbc != null">
and a.mrbc = #{dto.mrbc}
</if>
<if test="dto.pbksrq != null and dto.pbjsrq != null">
and (
a.pbksrq between #{dto.pbksrq} and #{dto.pbjsrq} or
a.pbjsrq between #{dto.pbksrq} and #{dto.pbjsrq}
)
</if>
order by a.pbksrq desc
limit #{pageIndex},#{pageSize}
</select>
<select id="checkThisTimeXfpb" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpbMrjl">
<![CDATA[
select * from tb_qw_xfpb_mrjl a where
xfkssj BETWEEN DATE_FORMAT(date_add(now(),interval - 2 hour), '%Y-%m-%d %H:%i:%s')
and DATE_FORMAT(date_add(now(),interval + 2 hour), '%Y-%m-%d %H:%i:%s')
]]>
</select>
<select id="getPbBySjAndJl" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpb">
select * from tb_qw_xfpb a where a.xt_sjzt = '1' and a.xt_scbz = '0'
<if test="id != null and id !=''">
and a.id != #{id}
</if>
<![CDATA[
and a.id in (
select b.pb_id from tb_qw_xfpb_zq b where b.xt_sjzt = '1' and b.xt_scbz = '0'
and (
b.fzr_id = #{jlId} or
b.id in (
select c.ywid from tb_qw_jl c where c.jl_id = #{jlId}
)
)
and (
case when b.kssj >= b.jssj then
#{kssj} between concat('1970-01-01 ',DATE_FORMAT(b.kssj,'%H:%i:%s')) and concat('1970-01-02 ',DATE_FORMAT(b.kssj,'%H:%i:%s')) or
#{jssj} between concat('1970-01-01 ',DATE_FORMAT(b.kssj,'%H:%i:%s')) and concat('1970-01-02 ',DATE_FORMAT(b.kssj,'%H:%i:%s'))
when b.kssj < b.jssj then
#{kssj} between concat('1970-01-01 ',DATE_FORMAT(b.kssj,'%H:%i:%s')) and concat('1970-01-01 ',DATE_FORMAT(b.kssj,'%H:%i:%s')) or
#{jssj} between concat('1970-01-01 ',DATE_FORMAT(b.kssj,'%H:%i:%s')) and concat('1970-01-01 ',DATE_FORMAT(b.kssj,'%H:%i:%s'))
end
)
)
and (
#{pbksrq} between DATE_FORMAT(a.pbksrq,'%Y-%m-%d') and DATE_FORMAT(a.pbjsrq,'%Y-%m-%d') or
#{pbjsrq} between DATE_FORMAT(a.pbksrq,'%Y-%m-%d') and DATE_FORMAT(a.pbjsrq,'%Y-%m-%d')
)
]]>
</select>
</mapper>

View File

@ -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.mosty.qwzx.mapper.TbQwXfpbMrjlMapper">
<update id="deleteByYwid">
delete
from tb_qw_xfpb_mrjl
where pb_id = #{pbId}
and pbzq_id = #{pbzqId}
</update>
<select id="getMrjlByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpbMrjl">
<![CDATA[
select * from tb_qw_xfpb_mrjl a where (
(
DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') > #{xfkssj}
and DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') < #{xfjssj}
) or (
DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') > #{xfkssj}
and DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') < #{xfjssj}
)
)
]]>
<if test="pbid != null and pbid != ''">
and a.pb_id != #{pbid}
</if>
</select>
</mapper>

View File

@ -0,0 +1,68 @@
<?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.mosty.qwzx.mapper.TbQwXfpbZqMapper">
<!--删除值班排班信息-->
<delete id="deleteByPbId" parameterType="String">
delete
from tb_qw_xfpb_zq
where pb_id = #{pbId}
</delete>
<!--APP获取我的排班信息-->
<select id="getMyXfpbToday" resultType="com.mosty.base.model.vo.qwzx.TbQwXfpbZqMyVo" parameterType="String">
<![CDATA[
select b.*,a.id as mrjlid
from tb_qw_xfpb_zq b,tb_qw_xfpb_mrjl a
where a.pbzq_id = b.id
and b.xt_scbz = '0'
and b.xt_sjzt = '1'
and (b.fzr_id = #{userId} or b.id in
(select ywid
from tb_qw_jl c
where c.ywid = b.id
and c.jl_id = #{userId}
and c.xt_scbz = '0'
and c.xt_sjzt = '1'
)
)
and a.xfkssj BETWEEN DATE_FORMAT(date_add(now(),interval - 2 hour), '%Y-%m-%d %H:%i:%s')
and DATE_FORMAT(date_add(now(),interval + 2 hour), '%Y-%m-%d %H:%i:%s')
order by a.xfkssj
limit 1
]]>
</select>
<select id="getMyXfpbByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpbZq">
select b.* from tb_qw_xfpb_zq b,tb_qw_xfpb_mrjl a
where a.pbzq_id = b.id
and b.xt_scbz = '0'
and b.xt_sjzt = '1'
and (b.fzr_id = #{userId} or b.id in
(select ywid
from tb_qw_jl c
where c.ywid = b.id
and c.jl_id = #{userId}
and c.xt_scbz = '0'
and c.xt_sjzt = '1'
)
)
and DATE_FORMAT(#{kssj}, '%Y-%m-%d') = DATE_FORMAT(a.xfrq, '%Y-%m-%d')
</select>
<select id="getDeptByMonth" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpbZq">
select b.*
from tb_qw_xfpb_zq b,
tb_qw_xfpb_mrjl a
where a.pbzq_id = b.id
and b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.ssbmdm = #{ssbmdm}
and DATE_FORMAT(#{kssj}, '%Y-%m-%d') = DATE_FORMAT(a.xfrq, '%Y-%m-%d')
</select>
</mapper>

View File

@ -0,0 +1,211 @@
<?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.mosty.qwzx.mapper.TbQwZbbbMapper">
<resultMap id="BaseResultMap" type="com.mosty.base.model.vo.qwzx.TbQwZbbbVo">
<id column="id" property="id" jdbcType="VARCHAR"/>
<id column="qwbcid" property="qwbcid" jdbcType="VARCHAR"/>
<result column="zbrq" property="zbrq"/>
<result column="kssj" property="kssj"/>
<result column="jssj" property="jssj"/>
<result column="zbsc" property="zbsc"/>
<result column="zbldXm" property="zbld_xm"/>
<result column="zbldDh" property="zbld_dh"/>
<result column="zbld_id" property="zbldId"/>
<result column="zbzhz_xm" property="zbzhzXm"/>
<result column="zbzhz_id" property="zbzhzId"/>
<result column="zzzhz_xm" property="zzzhzXm"/>
<result column="zzzhz_id" property="zzzhzId"/>
<result column="fzzb_xm" property="fzzbXm"/>
<result column="fzzb_id" property="fzzbId"/>
<result column="zbmj" property="zbmj"/>
<result column="mjsl" property="mjsl"/>
<result column="txzbsl" property="txzbsl"/>
<result column="hh" property="hh"/>
<result column="zbzt" property="zbzt"/>
<result column="ssbm" property="ssbm"/>
<result column="ssbmdm" property="ssbmdm"/>
<result column="ssxgaj" property="ssxgaj"/>
<result column="ssxgajdm" property="ssxgajdm"/>
<result column="sssgaj" property="sssgaj"/>
<result column="sssgajdm" property="sssgajdm"/>
<result column="bz" property="bz"/>
<result column="zbmjxm" property="zbmjxm"/>
<collection property="jlList" javaType="ArrayList"
ofType="com.mosty.base.model.dto.qwzx.TbQwJlDto" select="selectJlList"
column="{ywid = id,zbmjxm = zbmjxm}"/>
</resultMap>
<resultMap id="resultMap" type="com.mosty.base.model.vo.qwzx.TbQwZbbbVo">
<id column="id" property="id" jdbcType="VARCHAR"/>
<id column="qwbcid" property="qwbcid" jdbcType="VARCHAR"/>
<result column="zbrq" property="zbrq"/>
<result column="kssj" property="kssj"/>
<result column="jssj" property="jssj"/>
<result column="zbsc" property="zbsc"/>
<result column="zbldXm" property="zbld_xm"/>
<result column="zbldDh" property="zbld_dh"/>
<result column="zbld_id" property="zbldId"/>
<result column="zbzhz_xm" property="zbzhzXm"/>
<result column="zbzhz_id" property="zbzhzId"/>
<result column="zzzhz_xm" property="zzzhzXm"/>
<result column="zzzhz_id" property="zzzhzId"/>
<result column="fzzb_xm" property="fzzbXm"/>
<result column="fzzb_id" property="fzzbId"/>
<result column="zbmj" property="zbmj"/>
<result column="mjsl" property="mjsl"/>
<result column="txzbsl" property="txzbsl"/>
<result column="hh" property="hh"/>
<result column="zbzt" property="zbzt"/>
<result column="ssbm" property="ssbm"/>
<result column="ssbmdm" property="ssbmdm"/>
<result column="ssxgaj" property="ssxgaj"/>
<result column="ssxgajdm" property="ssxgajdm"/>
<result column="sssgaj" property="sssgaj"/>
<result column="sssgajdm" property="sssgajdm"/>
<result column="bz" property="bz"/>
</resultMap>
<resultMap type="com.mosty.base.model.dto.qwzx.TbQwJlDto" id="TbQwJlDto">
<id column="id" property="id"/>
<result column="ywid" property="ywid"/>
<result column="jl_id" property="jlId"/>
<result column="jllx" property="jllx"/>
<result column="jlxm" property="jlxm"/>
<result column="jh" property="jh"/>
<result column="xbdm" property="xbdm"/>
<result column="nl" property="nl"/>
<result column="jlzt" property="jlzt"/>
<result column="zblx" property="zblx"/>
</resultMap>
<select id="selectJlList" resultMap="TbQwJlDto">
select b.id,
b.ywid,
b.jl_id,
b.jllx,
b.jlxm,
b.xbdm,
b.nl,
b.jlzt,
b.zblx
from tb_qw_jl b
where b.xt_sjzt = '1'
and b.xt_scbz = '0'
and b.ywid = #{ywid}
and b.jllx = '01'
</select>
<!--查询-->
<select id="queryList" resultMap="BaseResultMap">
select a.id,a.zbrq,a.ksrq,a.jsrq,a.zbsc,a.zbld_xm,a.zbld_dh,a.zbmj,a.mjsl,a.txzbsl,a.hh,a.zbzt,
a.ssbm,a.ssbmdm,a.bz,#{params.zbmjxm} as zbmjxm
from tb_qw_zbbb a
where a.xt_scbz = '0'
<if test="params.zbmjxm != null and params.zbmjxm != ''">
and a.zbmj like concat('%',#{params.zbmjxm},'%')
</if>
<if test="params.kssj != null and params.jssj == null">
and a.zbrq &gt;= #{params.kssj,jdbcType=DATE}
</if>
<if test="params.kssj == null and params.jssj != null">
and a.zbrq &lt;= #{params.jssj,jdbcType=DATE}
</if>
<if test="params.kssj != null and params.jssj != null">
and a.zbrq between #{params.kssj,jdbcType=DATE} and #{params.jssj,jdbcType=DATE}
</if>
<if test="params.zbld != null and params.zbld != ''">
and a.zbld like concat('%',#{params.zbld},'%')
</if>
<if test="params.zbzt != null and params.zbzt != ''">
and a.zbld = #{params.zbld,jdbcType=VARCHAR}
</if>
<if test="params.xtSjly != null and params.xtSjly != ''">
and a.xt_sjly = #{params.xtSjly,jdbcType=VARCHAR}
</if>
<if test="params.xtSjzt != null and params.xtSjzt != ''">
and a.xt_sjzt = #{params.xtSjzt,jdbcType=VARCHAR}
</if>
<if test="params.ssbmdm != null and params.ssbmdm != ''">
and a.ssbmdm like concat(#{params.ssbmdm,jdbcType=VARCHAR},'%')
</if>
<!-- <if test="params.ssxgajdm != null and params.ssxgajdm != ''">-->
<!-- and a.ssxgajdm = #{params.ssxgajdm,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- <if test="params.sssgajdm != null and params.sssgajdm != ''">-->
<!-- and a.sssgajdm = #{params.sssgajdm,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- 数据范围过滤 -->
<!-- ${createSql}-->
</select>
<!--id查询-->
<select id="queryById" resultMap="BaseResultMap">
select a.*, b.*, '' as zbmjxm
from tb_qw_zbbb a
inner join tb_qw_jl b on a.id = b.ywid
where a.xt_scbz = '0'
and a.id = #{id,jdbcType=VARCHAR}
</select>
<!--删除值班-->
<update id="deleteZb">
update tb_qw_zbbb set xt_scbz = '1' where id in
<foreach collection="id" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<!--APP获取-->
<select id="getMyBbInfoToday" resultType="com.mosty.base.model.entity.qwzx.TbQwZbbb">
select *
from tb_qw_zbbb a
where a.xt_scbz = '0'
and a.xt_sjzt = '1'
and DATEDIFF(a.zbrq, NOW()) = 0
and a.bbzt = '0'
and a.bbjssj is null
and (
a.zbld_id = #{userId}
or a.zbzhz_id = #{userId}
or a.zzzhz_id = #{userId}
or a.fzzb_id = #{userId}
or a.id in (select ywid
from tb_qw_jl b
where b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.ywid = a.id
and b.jl_id = #{userId}
)
)
limit 1
</select>
<select id="getMybbTodayByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwZbbb">
select *
from tb_qw_zbbb a
where a.xt_scbz = '0'
and a.xt_sjzt = '1'
<if test="time != null and time != ''">
and date_format(a.zbrq,'%Y-%m-%d') = #{time}
</if>
and a.bbzt = '0'
and a.bbjssj is null
and (
a.zbld_id = #{userId}
or a.zbzhz_id = #{userId}
or a.zzzhz_id = #{userId}
or a.fzzb_id = #{userId}
or a.id in (select ywid
from tb_qw_jl b
where b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.ywid = a.id)
)
</select>
</mapper>

View File

@ -0,0 +1,105 @@
<?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.mosty.qwzx.mapper.TbQwZbpbMapper">
<!--根据条件按查询总数-->
<select id="getCount" resultType="Integer" parameterType="Map">
select count(1) from tb_qw_zbpb a where a.xt_scbz = '0' and a.xt_scbz = '0'
and a.id in (
select pb_id from tb_qw_zbpb_zq b where b.xt_scbz = '0' and b.xt_scbz = '0'
and (
b.zbld_id = #{ryid} or b.zbzhz_id = #{ryid} or b.zzzhz_id = #{ryid} or b.fzzb_id = #{ryid}
or b.id in (
select ywid from tb_qw_jl c where c.xt_scbz = '0' and c.xt_scbz = '0' and jl_id = #{ryid}
)
)
)
<if test="dto.jsrqlx != null and dto.jsrqlx != ''">
and a.jsrqlx = #{dto.jsrqlx}
</if>
<if test="dto.xhlx != null and dto.xhlx != ''">
and a.xhlx = #{dto.xhlx}
</if>
<if test="dto.xhzq != null">
and a.xhzq = #{dto.xhzq}
</if>
<if test="dto.zbpbksrq != null and dto.zbpbjsrq != null">
and (
a.zbpbksrq between #{dto.zbpbksrq} and #{dto.zbpbjsrq} or
a.zbpbjsrq between #{dto.zbpbksrq} and #{dto.zbpbjsrq}
)
</if>
</select>
<!--根据条件按查询总数-->
<select id="getList" resultType="com.mosty.base.model.entity.qwzx.TbQwZbpb" parameterType="Map">
select a.* from tb_qw_zbpb a where a.xt_scbz = '0' and a.xt_scbz = '0'
and a.id in (
select pb_id from tb_qw_zbpb_zq b where b.xt_scbz = '0' and b.xt_scbz = '0'
and (
b.zbld_id = #{ryid} or b.zbzhz_id = #{ryid} or b.zzzhz_id = #{ryid} or b.fzzb_id = #{ryid}
or b.id in (
select ywid from tb_qw_jl c where c.xt_scbz = '0' and c.xt_scbz = '0' and jl_id = #{ryid}
)
)
)
<if test="dto.jsrqlx != null and dto.jsrqlx != ''">
and a.jsrqlx = #{dto.jsrqlx}
</if>
<if test="dto.xhlx != null and dto.xhlx != ''">
and a.xhlx = #{dto.xhlx}
</if>
<if test="dto.xhzq != null">
and a.xhzq = #{dto.xhzq}
</if>
<if test="dto.zbpbksrq != null and dto.zbpbjsrq != null">
and (
a.zbpbksrq between #{dto.zbpbksrq} and #{dto.zbpbjsrq} or
a.zbpbjsrq between #{dto.zbpbksrq} and #{dto.zbpbjsrq}
)
</if>
order by a.zbpbksrq desc
limit #{pageIndex},#{pageSize}
</select>
<select id="checkThisTimeZbpb" resultType="com.mosty.base.model.entity.qwzx.TbQwZbpbMrjl">
<![CDATA[
select * from tb_qw_zbpb_mrjl a where
zbkssj BETWEEN DATE_FORMAT(date_add(now(),interval - 2 hour), '%Y-%m-%d %H:%i:%s')
and DATE_FORMAT(date_add(now(),interval + 2 hour), '%Y-%m-%d %H:%i:%s')
]]>
</select>
<select id="getZbBySjAndJl" resultType="com.mosty.base.model.entity.qwzx.TbQwZbpb">
select * from tb_qw_zbpb a where a.xt_sjzt = '1' and a.xt_scbz = '0'
<if test="id != null and id !=''">
and a.id != #{id}
</if>
<![CDATA[
and a.id in (
select b.pb_id from tb_qw_zbpb_zq b where b.xt_sjzt = '1' and b.xt_scbz = '0'
and (
b.zbld_id = #{jlId} or
b.zbzhz_id = #{jlId} or
b.zzzhz_id = #{jlId} or
b.fzzb_id = #{jlId} or
b.id in (
select c.ywid from tb_qw_jl c where c.jl_id = #{jlId}
)
)
and b.id in (
select d.pbzq_id from tb_qw_zbpb_mrjl d
case when b.kssj >= b.jssj then
#{kssj} between DATE_FORMAT(b.kssj,'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(b.jssj,'%Y-%m-%d %H:%i:%s') or
#{jssj} between DATE_FORMAT(b.kssj,'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(b.jssj,'%Y-%m-%d %H:%i:%s')
)
)
and (
#{zbpbksrq} between DATE_FORMAT(a.zbpbksrq,'%Y-%m-%d') and DATE_FORMAT(a.zbpbjsrq,'%Y-%m-%d') or
#{zbpbjsrq} between DATE_FORMAT(a.zbpbksrq,'%Y-%m-%d') and DATE_FORMAT(a.zbpbjsrq,'%Y-%m-%d')
)
]]>
</select>
</mapper>

View File

@ -0,0 +1,29 @@
<?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.mosty.qwzx.mapper.TbQwZbpbMrjlMapper">
<update id="deleteByYwid">
delete
from tb_qw_zbpb_mrjl
where pb_id = #{pbId}
and pbzq_id = #{pbzqId}
</update>
<select id="getMrjlByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwZbpbMrjl">
<![CDATA[
select * from tb_qw_zbpb_mrjl a where (
(
DATE_FORMAT(a.zbkssj,'%Y-%m-%d %H:%i:%s') > #{zbkssj}
and DATE_FORMAT(a.zbkssj,'%Y-%m-%d %H:%i:%s') < #{zbjssj}
) or (
DATE_FORMAT(a.zbjssj,'%Y-%m-%d %H:%i:%s') > #{zbkssj}
and DATE_FORMAT(a.zbjssj,'%Y-%m-%d %H:%i:%s') < #{zbjssj}
)
)
]]>
<if test="pbid != null and pbid != ''">
and a.pb_id != #{pbid}
</if>
</select>
</mapper>

View File

@ -0,0 +1,74 @@
<?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.mosty.qwzx.mapper.TbQwZbpbZqMapper">
<!--删除值班排班信息-->
<delete id="deleteByPbId" parameterType="String">
delete
from tb_qw_zbpb_zq
where pb_id = #{pbId}
</delete>
<select id="getMyZbpbToday" resultType="com.mosty.base.model.vo.qwzx.TbQwZbpbZqMyVo">
<![CDATA[
select b.*, a.id as mrjlid
from tb_qw_zbpb_zq b,
tb_qw_zbpb_mrjl a
where a.pbzq_id = b.id
and b.xt_scbz = '0'
and b.xt_sjzt = '1'
and (b.zbld_id = #{userId}
or b.zbzhz_id = #{userId}
or b.zzzhz_id = #{userId}
or b.fzzb_id = #{userId}
or b.id in
(select ywid
from tb_qw_jl c
where c.ywid = b.id
and c.jl_id = #{userId}
and c.xt_scbz = '0'
and c.xt_sjzt = '1'
)
)
and zbkssj BETWEEN DATE_FORMAT(date_add(now(),interval - 2 hour), '%Y-%m-%d %H:%i:%s')
and DATE_FORMAT(date_add(now(),interval + 2 hour), '%Y-%m-%d %H:%i:%s')
order by zbkssj
limit 1
]]>
</select>
<select id="getMyZbpbByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwZbpbZq">
select b.*
from tb_qw_zbpb_zq b,
tb_qw_zbpb_mrjl a
where a.pbzq_id = b.id
and b.xt_scbz = '0'
and b.xt_sjzt = '1'
and (b.zbld_id = #{userId} or
b.zbzhz_id = #{userId} or
b.zzzhz_id = #{userId} or
b.fzzb_id = #{userId} or
b.id in
(select ywid
from tb_qw_jl c
where c.ywid = b.id
and c.jl_id = #{userId}
and c.xt_scbz = '0'
and c.xt_sjzt = '1'
)
)
and DATE_FORMAT(#{kssj}, '%Y-%m-%d') = DATE_FORMAT(a.zbrq, '%Y-%m-%d')
</select>
<select id="getDeptByMonth" resultType="com.mosty.base.model.entity.qwzx.TbQwZbpbZq">
select b.*
from tb_qw_zbpb_zq b,
tb_qw_zbpb_mrjl a
where a.pbzq_id = b.id
and b.xt_scbz = '0'
and b.xt_sjzt = '1'
and b.ssbmid = #{ssbmid}
and DATE_FORMAT(#{kssj}, '%Y-%m-%d') = DATE_FORMAT(a.zbrq, '%Y-%m-%d')
</select>
</mapper>

View File

@ -0,0 +1,29 @@
<?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.mosty.qwzx.mapper.TbQwZnzbMapper">
<!--根据ID删除智能装备明细-->
<update id="deleteZnzb">
update tb_qw_znzb set xt_scbz = '1' where id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
<!--根据业务ID删除明细-->
<update id="deleteByYwid">
delete from tb_qw_znzb where ywid = #{ywid}
</update>
<select id="queryListByYwid" resultType="com.mosty.base.model.entity.qwzx.TbQwZnzb">
select a.* from tb_qw_znzb a
where a.xt_scbz = '0'
and a.ywid in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>mosty-qwzx</id>
<classpath>
<dir name="E:/project/rs/mosty-dyga-cloud/mosty-qwzx/target/classes">
</dir>
</classpath>
</application>