OdsXwcbjXzxkxxbMapper.xml 9.24 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.OdsXwcbjXzxkxxbMapper">
    
    <resultMap type="OdsXwcbjXzxkxxb" id="OdsXwcbjXzxkxxbResult">
        <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="xkXdrLb"    column="xk_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="xkXdrSydw"    column="xk_xdr_sydw"    />
        <result property="xkXdrShzz"    column="xk_xdr_shzz"    />
        <result property="xkFrdb"    column="xk_frdb"    />
        <result property="xkFrZjlx"    column="xk_fr_zjlx"    />
        <result property="xkFrZjhm"    column="xk_fr_zjhm"    />
        <result property="certificateType"    column="certificate_type"    />
        <result property="idNum"    column="id_num"    />
        <result property="xkXkws"    column="xk_xkws"    />
        <result property="xkwjbh"    column="xkwjbh"    />
        <result property="xkXklb"    column="xk_xklb"    />
        <result property="xkXkzs"    column="xk_xkzs"    />
        <result property="xkXkbh"    column="xk_xkbh"    />
        <result property="xkNr"    column="xk_nr"    />
        <result property="beginTime"    column="begin_time"    />
        <result property="xkYxqz"    column="xk_yxqz"    />
        <result property="xkYxqzi"    column="xk_yxqzi"    />
        <result property="xkXkjg"    column="xk_xkjg"    />
        <result property="xkXkjgdm"    column="xk_xkjgdm"    />
        <result property="djzt"    column="djzt"    />
        <result property="xkLydw"    column="xk_lydw"    />
        <result property="xkLydwdm"    column="xk_lydwdm"    />
        <result property="bz"    column="bz"    />
        <result property="ywId"    column="yw_id"    />
        <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="issync"    column="issync"    />
        <result property="xkwjbhTemp"    column="xkwjbh_temp"    />
        <result property="dataInfo"    column="data_info"    />
        <result property="qiyeName"    column="qiye_name"    />
    </resultMap>

    <sql id="selectOdsXwcbjXzxkxxbVo">
        select id, tjfs, user_id, user_name, create_time, is_bs, xk_xdr_lb, object_name, credit_code, qyzch, object_id, swdj, xk_xdr_sydw, xk_xdr_shzz, xk_frdb, xk_fr_zjlx, xk_fr_zjhm, certificate_type, id_num, xk_xkws, xkwjbh, xk_xklb, xk_xkzs, xk_xkbh, xk_nr, begin_time, xk_yxqz, xk_yxqzi, xk_xkjg, xk_xkjgdm, djzt, xk_lydw, xk_lydwdm, bz, yw_id, unit_id, unit_name, public_state, public_time, public_userid, note, bs_time, issync, xkwjbh_temp, data_info, qiye_name from xz_xk
    </sql>

    <select id="selectOdsXwcbjXzxkxxbList" parameterType="OdsXwcbjXzxkxxb" resultMap="OdsXwcbjXzxkxxbResult">
        <include refid="selectOdsXwcbjXzxkxxbVo"/>
        <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 = #{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="xkXdrLb != null  and xkXdrLb != ''"> and xk_xdr_lb = #{xkXdrLb}</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="xkXdrSydw != null  and xkXdrSydw != ''"> and xk_xdr_sydw = #{xkXdrSydw}</if>
            <if test="xkXdrShzz != null  and xkXdrShzz != ''"> and xk_xdr_shzz = #{xkXdrShzz}</if>
            <if test="xkFrdb != null  and xkFrdb != ''"> and xk_frdb = #{xkFrdb}</if>
            <if test="xkFrZjlx != null  and xkFrZjlx != ''"> and xk_fr_zjlx = #{xkFrZjlx}</if>
            <if test="xkFrZjhm != null  and xkFrZjhm != ''"> and xk_fr_zjhm = #{xkFrZjhm}</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="xkXkws != null  and xkXkws != ''"> and xk_xkws = #{xkXkws}</if>
            <if test="xkwjbh != null  and xkwjbh != ''"> and xkwjbh = #{xkwjbh}</if>
            <if test="xkXklb != null  and xkXklb != ''"> and xk_xklb = #{xkXklb}</if>
            <if test="xkXkzs != null  and xkXkzs != ''"> and xk_xkzs = #{xkXkzs}</if>
            <if test="xkXkbh != null  and xkXkbh != ''"> and xk_xkbh = #{xkXkbh}</if>
            <if test="xkNr != null  and xkNr != ''"> and xk_nr = #{xkNr}</if>
            <if test="beginTime != null  and beginTime != ''"> and begin_time = #{beginTime}</if>
            <if test="xkYxqz != null  and xkYxqz != ''"> and xk_yxqz = #{xkYxqz}</if>
            <if test="xkYxqzi != null  and xkYxqzi != ''"> and xk_yxqzi = #{xkYxqzi}</if>
            <if test="xkXkjg != null  and xkXkjg != ''"> and xk_xkjg = #{xkXkjg}</if>
            <if test="xkXkjgdm != null  and xkXkjgdm != ''"> and xk_xkjgdm = #{xkXkjgdm}</if>
            <if test="djzt != null  and djzt != ''"> and djzt = #{djzt}</if>
            <if test="xkLydw != null  and xkLydw != ''"> and xk_lydw = #{xkLydw}</if>
            <if test="xkLydwdm != null  and xkLydwdm != ''"> and xk_lydwdm = #{xkLydwdm}</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</if>
            <if test="ywId != null  and ywId != ''"> and yw_id = #{ywId}</if>
            <if test="unitId != null  and unitId != ''"> and unit_id = #{unitId}</if>
            <if test="unitName != null  and unitName != ''"> and unit_name = #{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="issync != null  and issync != ''"> and issync = #{issync}</if>
            <if test="xkwjbhTemp != null  and xkwjbhTemp != ''"> and xkwjbh_temp = #{xkwjbhTemp}</if>
            <if test="dataInfo != null  and dataInfo != ''"> and data_info = #{dataInfo}</if>
            <if test="qiyeName != null  and qiyeName != ''"> and qiye_name like concat('%',#{qiyeName}, '%')</if>
        </where>
    </select>
    
    <select id="selectOdsXwcbjXzxkxxbById" parameterType="String" resultMap="OdsXwcbjXzxkxxbResult">
        <include refid="selectOdsXwcbjXzxkxxbVo"/>
        where id = #{id}
    </select>

    <select id="getOldestXzxkxxb" resultMap="OdsXwcbjXzxkxxbResult">
        <include refid="selectOdsXwcbjXzxkxxbVo"/> order by create_time limit 1
    </select>

    <select id="searchPageXzxkxxb" parameterType="com.credit.cy.center.model.query.CenterXzxkQuery" resultMap="OdsXwcbjXzxkxxbResult">
        <include refid="selectOdsXwcbjXzxkxxbVo"/>
        <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="searchPageXzxkxxbXw" parameterType="com.credit.cy.center.model.query.CenterXzxkQueryNew" resultMap="OdsXwcbjXzxkxxbResult">
        <include refid="selectOdsXwcbjXzxkxxbVo"/>
        <where>
            <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>
        order by create_time asc
    </select>


</mapper>