<?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.zjrs.ggfw.sggfw.entity.GrJbxxMapper">

    <select id="getGrjbxx" resultType="com.zjrs.ggfw.sggfw.po.GrJbxxPO">
        select TID, a.ztid as AAC001,a.AAC003,F_RLZY_TRANSCODE('JBXX_AAC161',a.AAC161) AAC161,
        a.AAC006,F_RLZY_TRANSCODE('JBXX_AAC004',a.AAC004) AAC004, F_RLZY_TRANSCODE('JBXX_AAC005',a.AAC005) AAC005,
        F_RLZY_TRANSCODE('JBXX_AAC009',a.AAC009) AAC009,a.AAC147,F_RLZY_TRANSCODE('JBXX_AAC058',a.AAC058) AAC058,substr(a.AAC300,1,6) as AAB299,
        F_RLZY_TRANSCODE('JBXX_AAC011',a.AAC011) AAC011,a.bac073 as AAC180,a.bac977 as AAC181,a.bac075 as AAC183,
        a.aac010 as AAC010,a.AAC028,
        AAE006 as AAC046,BAE005,substr(AAC301,1,6) as AAF016 from ac01 a where
        a.ztid = #{grztid} 
    </select>


    <select id="xyUpdateGrjbxx" resultType="com.zjrs.ggfw.sggfw.po.GrJbxxPO">
        select TID, a.ztid as AAC001,a.AAC003,F_RLZY_TRANSCODE('JBXX_AAC161',a.AAC161) AAC161,
        a.AAC006,F_RLZY_TRANSCODE('JBXX_AAC004',a.AAC004) AAC004, F_RLZY_TRANSCODE('JBXX_AAC005',a.AAC005) AAC005,
        F_RLZY_TRANSCODE('JBXX_AAC009',a.AAC009) AAC009,a.AAC147,F_RLZY_TRANSCODE('JBXX_AAC058',a.AAC058) AAC058,substr(a.AAC300,1,6) as AAB299,
        F_RLZY_TRANSCODE('JBXX_AAC011',a.AAC011) AAC011,a.bac073 as AAC180,a.bac977 as AAC181,a.bac075 as AAC183,
        a.aac010 as AAC010,a.AAC028,
        AAE006 as AAC046,BAE005,substr(AAC301,1,6) as AAF016,b.xgsj from ac01 a, RS_RLZY_SJSB_PUSHDATAS b，RS_RLZY_SJSB_IDDZ c where 
        a.ztid = b.sid and c.sid = b.sid and a.Bae005 != b.xgsj
    </select>

    <select id="getXsbGrJbxx" resultType="com.zjrs.ggfw.sggfw.po.GrJbxxPO">
        select TID, a.ztid as AAC001,a.AAC003,F_RLZY_TRANSCODE('JBXX_AAC161',a.AAC161) AAC161,
        a.AAC006,F_RLZY_TRANSCODE('JBXX_AAC004',a.AAC004) AAC004, F_RLZY_TRANSCODE('JBXX_AAC005',a.AAC005) AAC005,
        F_RLZY_TRANSCODE('JBXX_AAC009',a.AAC009) AAC009,a.AAC147,F_RLZY_TRANSCODE('JBXX_AAC058',a.AAC058) AAC058,substr(a.AAC300,1,6) as AAB299,
        F_RLZY_TRANSCODE('JBXX_AAC011',a.AAC011) AAC011,a.bac073 as AAC180,a.bac977 as AAC181,a.bac075 as AAC183,
        a.aac010 as AAC010,a.AAC028,
        AAE006 as AAC046,BAE005,substr(AAC301,1,6) as AAF016 from ac01 a ,
        RS_RLZY_SJSB_IDDZ b where b.sid =  a.ztid        
    </select>



</mapper>
