| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <?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.BisInspAccuntDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspAccunt" id="bisInspAccuntResultMap">
- <result property="id" column="ID"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="province" column="PROVINCE"/>
- <result property="accuntPrp" column="ACCUNT_PRP"/>
- <result property="accuntMttr" column="ACCUNT_MTTR"/>
- <result property="accuntMprp" column="ACCUNT_MPRP"/>
- <result property="accuntName" column="ACCUNT_NAME"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="loc" column="LOC"/>
- <result property="accuntItem" column="ACCUNT_ITEM"/>
- <result property="accuntKind" column="ACCUNT_KIND"/>
- <result property="accuntTm" column="ACCUNT_TM"/>
- <result property="accuntStat" column="ACCUNT_STAT"/>
- <result property="note" column="NOTE"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="unitName" column="UNIT_NAME"/>
- <result property="dataStat" column="DATA_STAT"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- ORG_ID,
- PROVINCE,
- ACCUNT_PRP,
- ACCUNT_MTTR,
- ACCUNT_MPRP,
- ACCUNT_NAME,
- AD_CODE,
- AD_NAME,
- LOC,
- ACCUNT_ITEM,
- ACCUNT_KIND,
- ACCUNT_TM,
- ACCUNT_STAT,
- NOTE,
- PERS_ID,
- INTM,
- UPTM,
- UNIT_NAME,
- DATA_STAT
- </sql>
- <sql id="entity_properties">
- #{id},
- #{orgId},
- #{province},
- #{accuntPrp},
- #{accuntMttr},
- #{accuntMprp},
- #{accuntName},
- #{adCode},
- #{adName},
- #{loc},
- #{accuntItem},
- #{accuntKind},
- #{accuntTm},
- #{accuntStat},
- #{note},
- #{persId},
- #{intm},
- #{uptm},
- #{unitName},
- #{dataStat}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="year != null and year != ''">and to_char(ACCUNT_TM,'yyyy') = #{year}</if>
- <if test="province != null and province != ''">and PROVINCE like '%${province}%'</if>
- <if test="accuntPrp != null and accuntPrp != ''">and ACCUNT_PRP = #{accuntPrp}</if>
- <if test="accuntMttr != null and accuntMttr != ''">and ACCUNT_MTTR = #{accuntMttr}</if>
- <if test="accuntMprp != null and accuntMprp != ''">and ACCUNT_MPRP = #{accuntMprp}</if>
- <if test="accuntName != null and accuntName != ''">and ACCUNT_NAME = #{accuntName}</if>
- <if test="unitName != null and unitName != ''">and UNIT_NAME = #{unitName}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="adName != null and adName != ''">and AD_NAME like '%${adName}%'</if>
- <if test="loc != null and loc != ''">and LOC = #{loc}</if>
- <if test="accuntItem != null and accuntItem != ''">and ACCUNT_ITEM = #{accuntItem}</if>
- <if test="accuntKind != null and accuntKind != ''">and ACCUNT_KIND like '%${accuntKind}%'</if>
- <if test="accuntTm != null">and ACCUNT_TM = #{accuntTm}</if>
- <if test="accuntStat != null and accuntStat != ''">and ACCUNT_STAT = #{accuntStat}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- and DATA_STAT ='0'
- </trim>
- </sql>
- <select id="get" resultMap="bisInspAccuntResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ACCUNT where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspAccuntResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ACCUNT
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspAccuntResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ACCUNT
- </select>
- <select id="findList" resultMap="bisInspAccuntResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ACCUNT
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_ACCUNT
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
- insert into BIS_INSP_ACCUNT(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update BIS_INSP_ACCUNT set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
- delete from BIS_INSP_ACCUNT
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_ACCUNT set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
- update BIS_INSP_ACCUNT
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- <if test="accuntPrp != null and accuntPrp != ''">ACCUNT_PRP = #{accuntPrp},</if>
- <if test="accuntMttr != null and accuntMttr != ''">ACCUNT_MTTR = #{accuntMttr},</if>
- <if test="accuntMprp != null and accuntMprp != ''">ACCUNT_MPRP = #{accuntMprp},</if>
- <if test="accuntName != null and accuntName != ''">ACCUNT_NAME = #{accuntName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="loc != null and loc != ''">LOC = #{loc},</if>
- <if test="accuntItem != null and accuntItem != ''">ACCUNT_ITEM = #{accuntItem},</if>
- <if test="accuntKind != null and accuntKind != ''">ACCUNT_KIND = #{accuntKind},</if>
- <if test="accuntTm != null">ACCUNT_TM = #{accuntTm},</if>
- <if test="accuntStat != null and accuntStat != ''">ACCUNT_STAT = #{accuntStat},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
- update BIS_INSP_ACCUNT
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- <if test="accuntPrp != null and accuntPrp != ''">ACCUNT_PRP = #{accuntPrp},</if>
- <if test="accuntMttr != null and accuntMttr != ''">ACCUNT_MTTR = #{accuntMttr},</if>
- <if test="accuntMprp != null and accuntMprp != ''">ACCUNT_MPRP = #{accuntMprp},</if>
- <if test="accuntName != null and accuntName != ''">ACCUNT_NAME = #{accuntName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="loc != null and loc != ''">LOC = #{loc},</if>
- <if test="accuntItem != null and accuntItem != ''">ACCUNT_ITEM = #{accuntItem},</if>
- <if test="accuntKind != null and accuntKind != ''">ACCUNT_KIND = #{accuntKind},</if>
- <if test="accuntTm != null">ACCUNT_TM = #{accuntTm},</if>
- <if test="accuntStat != null and accuntStat != ''">ACCUNT_STAT = #{accuntStat},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|