| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- <?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="cn.com.goldenwater.dcproj.dao.AttWagaBaseImpDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttWagaBaseImp" id="attWagaBaseImpResultMap">
- <result property="id" column="ID"/>
- <result property="adCode1" column="AD_CODE1"/>
- <result property="adName1" column="AD_NAME1"/>
- <result property="adCode2" column="AD_CODE2"/>
- <result property="adName2" column="AD_NAME2"/>
- <result property="adCode3" column="AD_CODE3"/>
- <result property="adName3" column="AD_NAME3"/>
- <result property="objCode" column="OBJ_CODE"/>
- <result property="gateName" column="GATE_NAME"/>
- <result property="gateAdmName" column="GATE_ADM_NAME"/>
- <result property="engScal" column="ENG_SCAL"/>
- <result property="gateFlow" column="GATE_FLOW"/>
- <result property="ifGate" column="IF_GATE"/>
- <result property="ifDouDile" column="IF_DOU_DILE"/>
- <result property="gateAdmDep" column="GATE_ADM_DEP"/>
- <result property="gateType" column="GATE_TYPE"/>
- <result property="locationCun" column="LOCATION_CUN"/>
- <result property="engGrad" column="ENG_GRAD"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- AD_CODE1,
- AD_NAME1,
- AD_CODE2,
- AD_NAME2,
- AD_CODE3,
- AD_NAME3,
- OBJ_CODE,
- GATE_NAME,
- GATE_ADM_NAME,
- ENG_SCAL,
- GATE_FLOW,
- IF_GATE,
- IF_DOU_DILE,
- GATE_ADM_DEP,
- GATE_TYPE,
- LOCATION_CUN,
- ENG_GRAD
- </sql>
- <sql id="entity_properties">
- #{id},
- #{adCode1},
- #{adName1},
- #{adCode2},
- #{adName2},
- #{adCode3},
- #{adName3},
- #{objCode},
- #{gateName},
- #{gateAdmName},
- #{engScal},
- #{gateFlow},
- #{ifGate},
- #{ifDouDile},
- #{gateAdmDep},
- #{gateType},
- #{locationCun},
- #{engGrad}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="adCode1 != null and adCode1 != ''">and AD_CODE1 = #{adCode1}</if>
- <if test="adName1 != null and adName1 != ''">and AD_NAME1 = #{adName1}</if>
- <if test="adCode2 != null and adCode2 != ''">and AD_CODE2 = #{adCode2}</if>
- <if test="adName2 != null and adName2 != ''">and AD_NAME2 = #{adName2}</if>
- <if test="adCode3 != null and adCode3 != ''">and AD_CODE3 = #{adCode3}</if>
- <if test="adName3 != null and adName3 != ''">and AD_NAME3 = #{adName3}</if>
- <if test="objCode != null and objCode != ''">and OBJ_CODE = #{objCode}</if>
- <if test="gateName != null and gateName != ''">and GATE_NAME = #{gateName}</if>
- <if test="gateAdmName != null and gateAdmName != ''">and GATE_ADM_NAME = #{gateAdmName}</if>
- <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
- <if test="gateFlow != null and gateFlow != ''">and GATE_FLOW = #{gateFlow}</if>
- <if test="ifGate != null and ifGate != ''">and IF_GATE = #{ifGate}</if>
- <if test="ifDouDile != null and ifDouDile != ''">and IF_DOU_DILE = #{ifDouDile}</if>
- <if test="gateAdmDep != null and gateAdmDep != ''">and GATE_ADM_DEP = #{gateAdmDep}</if>
- <if test="gateType != null and gateType != ''">and GATE_TYPE = #{gateType}</if>
- <if test="locationCun != null and locationCun != ''">and LOCATION_CUN = #{locationCun}</if>
- <if test="engGrad != null and engGrad != ''">and ENG_GRAD = #{engGrad}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attWagaBaseImpResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_WAGA_BASE_IMP1 where ID = #{id}
- </select>
- <select id="getBy" resultMap="attWagaBaseImpResultMap">
- select <include refid="table_columns" /> from ATT_WAGA_BASE_IMP1 <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attWagaBaseImpResultMap">
- select <include refid="table_columns" /> from ATT_WAGA_BASE_IMP1
- </select>
- <select id="findList" resultMap="attWagaBaseImpResultMap">
- select <include refid="table_columns" /> from ATT_WAGA_BASE_IMP1 <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_WAGA_BASE_IMP1 <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBaseImp">
- insert into ATT_WAGA_BASE_IMP1( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_WAGA_BASE_IMP1 where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBaseImp">
- delete from ATT_WAGA_BASE_IMP1 <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_WAGA_BASE_IMP1 set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBaseImp">
- update ATT_WAGA_BASE_IMP1
- <trim prefix="set" suffixOverrides=",">
- <if test="adCode1 != null and adCode1 != ''">AD_CODE1 = #{adCode1},</if>
- <if test="adName1 != null and adName1 != ''">AD_NAME1 = #{adName1},</if>
- <if test="adCode2 != null and adCode2 != ''">AD_CODE2 = #{adCode2},</if>
- <if test="adName2 != null and adName2 != ''">AD_NAME2 = #{adName2},</if>
- <if test="adCode3 != null and adCode3 != ''">AD_CODE3 = #{adCode3},</if>
- <if test="adName3 != null and adName3 != ''">AD_NAME3 = #{adName3},</if>
- <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
- <if test="gateName != null and gateName != ''">GATE_NAME = #{gateName},</if>
- <if test="gateAdmName != null and gateAdmName != ''">GATE_ADM_NAME = #{gateAdmName},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="gateFlow != null and gateFlow != ''">GATE_FLOW = #{gateFlow},</if>
- <if test="ifGate != null and ifGate != ''">IF_GATE = #{ifGate},</if>
- <if test="ifDouDile != null and ifDouDile != ''">IF_DOU_DILE = #{ifDouDile},</if>
- <if test="gateAdmDep != null and gateAdmDep != ''">GATE_ADM_DEP = #{gateAdmDep},</if>
- <if test="gateType != null and gateType != ''">GATE_TYPE = #{gateType},</if>
- <if test="locationCun != null and locationCun != ''">LOCATION_CUN = #{locationCun},</if>
- <if test="engGrad != null and engGrad != ''">ENG_GRAD = #{engGrad},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaBaseImp">
- update ATT_WAGA_BASE_IMP1
- <trim prefix="set" suffixOverrides=",">
- <if test="adCode1 != null and adCode1 != ''">AD_CODE1 = #{adCode1},</if>
- <if test="adName1 != null and adName1 != ''">AD_NAME1 = #{adName1},</if>
- <if test="adCode2 != null and adCode2 != ''">AD_CODE2 = #{adCode2},</if>
- <if test="adName2 != null and adName2 != ''">AD_NAME2 = #{adName2},</if>
- <if test="adCode3 != null and adCode3 != ''">AD_CODE3 = #{adCode3},</if>
- <if test="adName3 != null and adName3 != ''">AD_NAME3 = #{adName3},</if>
- <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
- <if test="gateName != null and gateName != ''">GATE_NAME = #{gateName},</if>
- <if test="gateAdmName != null and gateAdmName != ''">GATE_ADM_NAME = #{gateAdmName},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="gateFlow != null and gateFlow != ''">GATE_FLOW = #{gateFlow},</if>
- <if test="ifGate != null and ifGate != ''">IF_GATE = #{ifGate},</if>
- <if test="ifDouDile != null and ifDouDile != ''">IF_DOU_DILE = #{ifDouDile},</if>
- <if test="gateAdmDep != null and gateAdmDep != ''">GATE_ADM_DEP = #{gateAdmDep},</if>
- <if test="gateType != null and gateType != ''">GATE_TYPE = #{gateType},</if>
- <if test="locationCun != null and locationCun != ''">LOCATION_CUN = #{locationCun},</if>
- <if test="engGrad != null and engGrad != ''">ENG_GRAD = #{engGrad},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="findAllNullCode" resultMap="attWagaBaseImpResultMap">
- select <include refid="table_columns" /> from ATT_WAGA_BASE_IMP1 where obj_code is null
- </select>
- <select id="findAllNew" resultMap="attWagaBaseImpResultMap">
- select <include refid="table_columns" /> from ATT_WAGA_BASE_IMP1 a where A.OBJ_CODE IS NULL or A.OBJ_CODE NOT IN (SELECT OBJ_CODE FROM ATT_WAGA_BASE) order by AD_CODE3
- </select>
- <select id="getMaxObjCode" resultType="java.lang.String" parameterType="java.lang.String">
- select max(obj_code) as obj_code from ATT_WAGA_BASE a where a.obj_code like concat(#{adCode},'%')
- </select>
- </mapper>
|