aiccs-api/src/main/resources/mybatis/mapper/crgs/punish/TbIlcPunInfoQueryMapper.xml

164 lines
7.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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.chinaweal.aiccs.crgs.punish.mapper.TbIlcPunInfoQueryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.chinaweal.aiccs.crgs.punish.entity.TbIlcPunInfoQuery">
<id column="ID" property="id" />
<result column="ZCH" property="zch" />
<result column="UNISCID" property="uniscid" />
<result column="SDSJ" property="sdsj" />
<result column="DSRMC" property="dsrmc" />
<result column="WFXW" property="wfxw" />
<result column="CFYJ" property="cfyj" />
<result column="SPUNCONTENT" property="spuncontent" />
<result column="CZSJ" property="czsj" />
<result column="S_SIGN_DATA" property="sSignData" />
<result column="S_SIGN_CERT" property="sSignCert" />
<result column="CFDJJG" property="cfdjjg" />
<result column="CFJDSJ" property="cfjdsj" />
<result column="XZCFLXFS" property="xzcflxfs" />
<result column="XZCFLXSJ" property="xzcflxsj" />
<result column="GSQX" property="gsqx" />
<result column="PENAM" property="penam" />
<result column="FORFAM" property="forfam" />
<result column="DTUPDATE" property="dtupdate" />
<result column="SCASECODE" property="scasecode" />
<result column="SREALCASECODE" property="srealcasecode" />
<result column="SBOOKCODE" property="sbookcode" />
<result column="SFLAG" property="sflag" />
<result column="UPDATETIME" property="updatetime" />
<result column="SSTATE" property="sstate" />
<result column="SGISTTYPECODE" property="sgisttypecode" />
<result column="SGISTTYPENAME" property="sgisttypename" />
<result column="SPUNTYPECODE" property="spuntypecode" />
<result column="SPUNTYPENAME" property="spuntypename" />
<result column="DSRTYPE" property="dsrtype" />
<result column="SYSTYPE" property="systype" />
<result column="DTCASEDATE" property="dtcasedate" />
<result column="SCHECKTYPE" property="schecktype" />
<result column="SCHECKTYPENAME" property="schecktypename" />
<result column="SPRINCIPAL" property="sprincipal" />
<result column="SPRINCIPALNO" property="sprincipalno" />
</resultMap>
<!--使用视图查询,改用表查询-->
<!-- &lt;!&ndash; 通用查询结果列 &ndash;&gt;-->
<!-- <sql id="Base_Column_List">-->
<!-- ID, ZCH, UNISCID, SDSJ, DSRMC, WFXW, CFYJ, SPUNCONTENT, CZSJ, S_SIGN_DATA, S_SIGN_CERT, CFDJJG, CFJDSJ, XZCFLXFS, XZCFLXSJ, GSQX, PENAM, FORFAM, DTUPDATE, SCASECODE, SREALCASECODE, SBOOKCODE, SFLAG, UPDATETIME, SSTATE, SGISTTYPECODE, SGISTTYPENAME, SPUNTYPECODE, SPUNTYPENAME, DSRTYPE, SYSTYPE, DTCASEDATE, SCHECKTYPE, SCHECKTYPENAME, SPRINCIPAL, SPRINCIPALNO-->
<!-- </sql>-->
<!-- <select id="searchByPage" resultMap="BaseResultMap">-->
<!-- &#45;&#45; 清洗过后的行政处罚试图-->
<!-- select * from V_CASE_PUB_NBASEINFO-->
<!-- <where>-->
<!-- <if test="params.uniscid != null and params.uniscid!= ''">-->
<!-- and uniscid = #{params.uniscid}-->
<!-- </if>-->
<!-- <if test="params.dsrmc != null and params.dsrmc != ''">-->
<!-- and dsrmc like concat('%', #{params.dsrmc}, '%')-->
<!-- </if>-->
<!-- <if test="params.cfdjjg != null and params.cfdjjg != ''">-->
<!-- and cfdjjg = #{params.cfdjjg}-->
<!-- </if>-->
<!-- </where>-->
<!-- </select>-->
<!-- <select id="findById" resultType="com.chinaweal.aiccs.crgs.punish.entity.TbIlcPunInfoQuery">-->
<!-- select * from V_CASE_PUB_NBASEINFO where id = #{id}-->
<!-- </select>-->
<!-- 通用查询结果列 -->
<sql id="As_Base_Column_List">
CASEID as id, REGNO as zch, UNISCID as uniscid, ENTNAME as dsrmc, PENDECNO as sbookcode, ILLEGACTTYPE as sgisttypename, PENAUTH_CN as cfdjjg, PENDECISSDATE as cfjdsj, PENCONTENT as spuncontent
</sql>
<!--使用表查询-->
<select id="searchByPage" resultMap="BaseResultMap">
select
<include refid="As_Base_Column_List"/>
from case_pub_nbaseinfo
where ACTYPE = '1'
<if test="params.region != null and params.region!= '' and params.region!= '市'.toString()">
and PENAUTH like concat(#{params.region}, '%')
</if>
<if test="params.uniscid != null and params.uniscid!= ''">
and (uniscid = #{params.uniscid} or REGNO = #{params.uniscid})
</if>
<if test="params.dsrmc != null and params.dsrmc != ''">
and ENTNAME like concat('%', #{params.dsrmc}, '%')
</if>
<if test="params.cfdjjg != null and params.cfdjjg != ''">
and PENAUTH_CN = #{params.cfdjjg}
</if>
</select>
<select id="findById" resultType="com.chinaweal.aiccs.crgs.punish.entity.TbIlcPunInfoQuery">
select <include refid="As_Base_Column_List"/> from case_pub_nbaseinfo where ACTYPE = '1' and CASEID = #{id}
</select>
<!-- 行政处罚记录UNION查询本省+外省) -->
<select id="searchUnionByPage" resultType="com.chinaweal.aiccs.crgs.punish.entity.TbIlcPunInfoQuery">
(
SELECT
CASEID AS id,
REGNO AS zch,
UNISCID AS uniscid,
ENTNAME AS dsrmc,
PENDECNO AS sbookcode,
ILLEGACTTYPE AS sgisttypename,
PENAUTH_CN AS cfdjjg,
PENDECISSDATE AS cfjdsj,
PENCONTENT AS spuncontent,
PENAM AS penam,
'外省' AS sflag
FROM AICCS.QG_CASE_PUB_NBASEINFO
WHERE ACTYPE = '1'
<if test="params.uniscid != null and params.uniscid != ''">
AND (UNISCID = #{params.uniscid} OR REGNO = #{params.uniscid})
</if>
<if test="params.entname != null and params.entname != ''">
AND ENTNAME LIKE '%' || #{params.entname} || '%'
</if>
<if test="params.penAuthCn != null and params.penAuthCn != ''">
AND PENAUTH_CN = #{params.penAuthCn}
</if>
<if test="params.penDecNo != null and params.penDecNo != ''">
AND PENDECNO = #{params.penDecNo}
</if>
AND (OPFLAG IS NULL OR OPFLAG != 'D')
)
UNION ALL
(
SELECT
CASEID AS id,
REGNO AS zch,
UNISCID AS uniscid,
ENTNAME AS dsrmc,
PENDECNO AS sbookcode,
ILLEGACTTYPE AS sgisttypename,
PENAUTH_CN AS cfdjjg,
PENDECISSDATE AS cfjdsj,
PENCONTENT AS spuncontent,
PENAM AS penam,
'本省' AS sflag
FROM case_pub_nbaseinfo
WHERE ACTYPE = '1'
<if test="params.region != null and params.region != '' and params.region != '市'.toString()">
AND PENAUTH LIKE concat(#{params.region}, '%')
</if>
<if test="params.uniscid != null and params.uniscid != ''">
AND (UNISCID = #{params.uniscid} OR REGNO = #{params.uniscid})
</if>
<if test="params.entname != null and params.entname != ''">
AND ENTNAME LIKE concat('%', #{params.entname}, '%')
</if>
<if test="params.penAuthCn != null and params.penAuthCn != ''">
AND PENAUTH_CN = #{params.penAuthCn}
</if>
)
</select>
</mapper>