OdsXwcbjXzcfxxbMapper.xml 10.2 KB
<?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.credit.cy.center.mapper.OdsXwcbjXzcfxxbMapper">
    
    <resultMap type="OdsXwcbjXzcfxxb" id="OdsXwcbjXzcfxxbResult">
        <result property="id"    column="id"    />
        <result property="tjfs"    column="tjfs"    />
        <result property="userId"    column="user_id"    />
        <result property="userName"    column="user_name"    />
        <result property="createTime"    column="create_time"    />
        <result property="isBs"    column="is_bs"    />
        <result property="cfXdrLb"    column="cf_xdr_lb"    />
        <result property="objectName"    column="object_name"    />
        <result property="creditCode"    column="credit_code"    />
        <result property="qyzch"    column="qyzch"    />
        <result property="objectId"    column="object_id"    />
        <result property="swdj"    column="swdj"    />
        <result property="cfXdrSydw"    column="cf_xdr_sydw"    />
        <result property="cfXdrShzz"    column="cf_xdr_shzz"    />
        <result property="cfFrdb"    column="cf_frdb"    />
        <result property="cfFrZjlx"    column="cf_fr_zjlx"    />
        <result property="cfFrZjhm"    column="cf_fr_zjhm"    />
        <result property="certificateType"    column="certificate_type"    />
        <result property="idNum"    column="id_num"    />
        <result property="cfjdswh"    column="cfjdswh"    />
        <result property="cfWfxw"    column="cf_wfxw"    />
        <result property="cfCflb"    column="cf_cflb"    />
        <result property="cfNrFk"    column="cf_nr_fk"    />
        <result property="cfNrWfff"    column="cf_nr_wfff"    />
        <result property="cfNrZkdx"    column="cf_nr_zkdx"    />
        <result property="cfJdrq"    column="cf_jdrq"    />
        <result property="cfYxq"    column="cf_yxq"    />
        <result property="cfGsjzq"    column="cf_gsjzq"    />
        <result property="cfYj"    column="cf_yj"    />
        <result property="cfSy"    column="cf_sy"    />
        <result property="cfNr"    column="cf_nr"    />
        <result property="bz"    column="bz"    />
        <result property="cfCfjg"    column="cf_cfjg"    />
        <result property="cfCfjgdm"    column="cf_cfjgdm"    />
        <result property="cfSjly"    column="cf_sjly"    />
        <result property="cfSjlydm"    column="cf_sjlydm"    />
        <result property="unitId"    column="unit_id"    />
        <result property="unitName"    column="unit_name"    />
        <result property="publicState"    column="public_state"    />
        <result property="publicTime"    column="public_time"    />
        <result property="publicUserid"    column="public_userid"    />
        <result property="note"    column="note"    />
        <result property="bsTime"    column="bs_time"    />
        <result property="linshitemp"    column="linshitemp"    />
        <result property="cfGsjzqZengnian"    column="cf_gsjzq_zengnian"    />
        <result property="issync"    column="issync"    />
        <result property="cfjdswhTemp"    column="cfjdswh_temp"    />
        <result property="dataInfo"    column="data_info"    />
    </resultMap>

    <sql id="selectOdsXwcbjXzcfxxbVo">
        select id, tjfs, user_id, user_name, create_time, is_bs, cf_xdr_lb, object_name, credit_code, qyzch, object_id, swdj, cf_xdr_sydw, cf_xdr_shzz, cf_frdb, cf_fr_zjlx, cf_fr_zjhm, certificate_type, id_num, cfjdswh, cf_wfxw, cf_cflb, cf_nr_fk, cf_nr_wfff, cf_nr_zkdx, cf_jdrq, cf_yxq, cf_gsjzq, cf_yj, cf_sy, cf_nr, bz, cf_cfjg, cf_cfjgdm, cf_sjly, cf_sjlydm, unit_id, unit_name, public_state, public_time, public_userid, note, bs_time, linshitemp, cf_gsjzq_zengnian, issync, cfjdswh_temp, data_info from xz_cf
    </sql>

    <sql id="selectSimpleXzcfxxbVo">
        select id, tjfs, user_id, user_name, create_time, cf_xdr_lb, object_name, credit_code, cf_frdb, cfjdswh, cf_cflb, cf_nr_fk, cf_nr_wfff, cf_nr_zkdx, cf_jdrq, cf_yxq, cf_gsjzq, cf_cfjg, cf_cfjgdm, cf_sjly, cf_sjlydm, unit_id, unit_name, public_state, public_time, public_userid, bs_time, issync, cfjdswh_temp, data_info from xz_cf
    </sql>

    <select id="selectOdsXwcbjXzcfxxbList" parameterType="OdsXwcbjXzcfxxb" resultMap="OdsXwcbjXzcfxxbResult">
        <include refid="selectOdsXwcbjXzcfxxbVo"/>
        <where>  
            <if test="tjfs != null  and tjfs != ''"> and tjfs = #{tjfs}</if>
            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
            <if test="userName != null  and userName != ''"> and user_name like concat('%',#{userName}, '%')</if>
            <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
            <if test="isBs != null  and isBs != ''"> and is_bs = #{isBs}</if>
            <if test="cfXdrLb != null  and cfXdrLb != ''"> and cf_xdr_lb = #{cfXdrLb}</if>
            <if test="objectName != null  and objectName != ''"> and object_name like concat('%',#{objectName}, '%')</if>
            <if test="creditCode != null  and creditCode != ''"> and credit_code = #{creditCode}</if>
            <if test="qyzch != null  and qyzch != ''"> and qyzch = #{qyzch}</if>
            <if test="objectId != null  and objectId != ''"> and object_id = #{objectId}</if>
            <if test="swdj != null  and swdj != ''"> and swdj = #{swdj}</if>
            <if test="cfXdrSydw != null  and cfXdrSydw != ''"> and cf_xdr_sydw = #{cfXdrSydw}</if>
            <if test="cfXdrShzz != null  and cfXdrShzz != ''"> and cf_xdr_shzz = #{cfXdrShzz}</if>
            <if test="cfFrdb != null  and cfFrdb != ''"> and cf_frdb = #{cfFrdb}</if>
            <if test="cfFrZjlx != null  and cfFrZjlx != ''"> and cf_fr_zjlx = #{cfFrZjlx}</if>
            <if test="cfFrZjhm != null  and cfFrZjhm != ''"> and cf_fr_zjhm = #{cfFrZjhm}</if>
            <if test="certificateType != null  and certificateType != ''"> and certificate_type = #{certificateType}</if>
            <if test="idNum != null  and idNum != ''"> and id_num = #{idNum}</if>
            <if test="cfjdswh != null  and cfjdswh != ''"> and cfjdswh = #{cfjdswh}</if>
            <if test="cfWfxw != null  and cfWfxw != ''"> and cf_wfxw = #{cfWfxw}</if>
            <if test="cfCflb != null  and cfCflb != ''"> and cf_cflb = #{cfCflb}</if>
            <if test="cfNrFk != null  and cfNrFk != ''"> and cf_nr_fk = #{cfNrFk}</if>
            <if test="cfNrWfff != null  and cfNrWfff != ''"> and cf_nr_wfff = #{cfNrWfff}</if>
            <if test="cfNrZkdx != null  and cfNrZkdx != ''"> and cf_nr_zkdx = #{cfNrZkdx}</if>
            <if test="cfJdrq != null "> and cf_jdrq = #{cfJdrq}</if>
            <if test="cfYxq != null "> and cf_yxq = #{cfYxq}</if>
            <if test="cfGsjzq != null "> and cf_gsjzq = #{cfGsjzq}</if>
            <if test="cfYj != null  and cfYj != ''"> and cf_yj = #{cfYj}</if>
            <if test="cfSy != null  and cfSy != ''"> and cf_sy = #{cfSy}</if>
            <if test="cfNr != null  and cfNr != ''"> and cf_nr = #{cfNr}</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</if>
            <if test="cfCfjg != null  and cfCfjg != ''"> and cf_cfjg = #{cfCfjg}</if>
            <if test="cfCfjgdm != null  and cfCfjgdm != ''"> and cf_cfjgdm = #{cfCfjgdm}</if>
            <if test="cfSjly != null  and cfSjly != ''"> and cf_sjly = #{cfSjly}</if>
            <if test="cfSjlydm != null  and cfSjlydm != ''"> and cf_sjlydm = #{cfSjlydm}</if>
            <if test="unitId != null  and unitId != ''"> and unit_id = #{unitId}</if>
            <if test="unitName != null  and unitName != ''"> and unit_name like concat('%',#{unitName}, '%')</if>
            <if test="publicState != null  and publicState != ''"> and public_state = #{publicState}</if>
            <if test="publicTime != null  and publicTime != ''"> and public_time = #{publicTime}</if>
            <if test="publicUserid != null  and publicUserid != ''"> and public_userid = #{publicUserid}</if>
            <if test="note != null  and note != ''"> and note = #{note}</if>
            <if test="bsTime != null "> and bs_time = #{bsTime}</if>
            <if test="linshitemp != null  and linshitemp != ''"> and linshitemp = #{linshitemp}</if>
            <if test="cfGsjzqZengnian != null  and cfGsjzqZengnian != ''"> and cf_gsjzq_zengnian = #{cfGsjzqZengnian}</if>
            <if test="issync != null  and issync != ''"> and issync = #{issync}</if>
            <if test="cfjdswhTemp != null  and cfjdswhTemp != ''"> and cfjdswh_temp = #{cfjdswhTemp}</if>
            <if test="dataInfo != null  and dataInfo != ''"> and data_info = #{dataInfo}</if>
        </where>
    </select>
    
    <select id="selectOdsXwcbjXzcfxxbById" parameterType="String" resultMap="OdsXwcbjXzcfxxbResult">
        <include refid="selectOdsXwcbjXzcfxxbVo"/>
        where id = #{id}
    </select>

    <select id="getOldestXzcfxxb" resultMap="OdsXwcbjXzcfxxbResult">
        <include refid="selectSimpleXzcfxxbVo"/> order by create_time limit 1
    </select>

    <select id="searchPageXzcfxxb" parameterType="com.credit.cy.center.model.query.CenterZxcfQuery" resultMap="OdsXwcbjXzcfxxbResult">
        <include refid="selectOdsXwcbjXzcfxxbVo"/>
        <where>
            <if test="null!=createTimeBegin"> and create_time >= #{createTimeBegin}</if>
            <if test="null!=createTimeEnd"> AND create_time <![CDATA[<=]]> #{createTimeEnd}</if>
        </where>
            order by create_time asc
    </select>

    <select id="searchPageXzcfXyxf"  resultMap="OdsXwcbjXzcfxxbResult">
        <include refid="selectOdsXwcbjXzcfxxbVo"/>
        where 1=1 and PUBLIC_STATE='3'
        order by create_time asc
    </select>

    <select id="searchPageXzcfxxbXw" parameterType="com.credit.cy.center.model.query.CenterZxcfQueryNew" resultMap="OdsXwcbjXzcfxxbResult">
        <include refid="selectOdsXwcbjXzcfxxbVo"/>
        <where>
            and data_info='1'
            <if test="null!=createTimeBegin"> and STR_TO_DATE(create_time,'%d/%m/%Y %H:%i:%s') >= #{createTimeBegin}</if>
            <if test="null!=createTimeEnd"> AND STR_TO_DATE(create_time,'%d/%m/%Y %H:%i:%s') <![CDATA[<=]]> #{createTimeEnd}</if>
        </where>
    </select>
</mapper>