| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <?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.AttPkxBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttPkxBase" id="attPkxBaseResultMap">
- <result property="code" column="CODE"/>
- <result property="name" column="NAME"/>
- <result property="lv" column="LV"/>
- <result property="pkfq" column="PKFQ"/>
- <result property="pw" column="PW"/>
- <result property="zdx" column="ZDX"/>
- <result property="sdpk" column="SDPK"/>
- <result property="sqsz" column="SQSZ"/>
- <result property="bjx" column="BJX"/>
- <result property="gblq" column="GBLQ"/>
- <result property="mzx" column="MZX"/>
- <result property="zysq" column="ZYSQ"/>
- <result property="tcx" column="TCX"/>
- <result property="ddfp" column="DDFP"/>
- </resultMap>
- <sql id="table_columns">
- CODE,
- NAME,
- LV,
- PKFQ,
- PW,
- ZDX,
- SDPK,
- SQSZ,
- BJX,
- GBLQ,
- MZX,
- ZYSQ,
- TCX,
- DDFP
- </sql>
- <sql id="entity_properties">
- #{code},
- #{name},
- #{lv},
- #{pkfq},
- #{pw},
- #{zdx},
- #{sdpk},
- #{sqsz},
- #{bjx},
- #{gblq},
- #{mzx},
- #{zysq},
- #{tcx},
- #{ddfp}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="code != null and code != ''">and CODE like concat(#{code},'%')</if>
- <if test="name != null and name != ''">and NAME like concat('%',concat(#{name},'%'))</if>
- <if test="lv != null and lv != ''">and LV = #{lv}</if>
- <if test="pkfq != null and pkfq != ''">and PKFQ = #{pkfq}</if>
- <if test="pw != null and pw != ''">and PW = #{pw}</if>
- <if test="zdx != null and zdx != ''">and ZDX = #{zdx}</if>
- <if test="sdpk != null and sdpk != ''">and SDPK = #{sdpk}</if>
- <if test="sqsz != null and sqsz != ''">and SQSZ = #{sqsz}</if>
- <if test="bjx != null and bjx != ''">and BJX = #{bjx}</if>
- <if test="gblq != null and gblq != ''">and GBLQ = #{gblq}</if>
- <if test="mzx != null and mzx != ''">and MZX = #{mzx}</if>
- <if test="zysq != null and zysq != ''">and ZYSQ = #{zysq}</if>
- <if test="tcx != null and tcx != ''">and TCX = #{tcx}</if>
- <if test="ddfp != null and ddfp != ''">and DDFP = #{ddfp}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attPkxBaseResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_PKX_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attPkxBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_PKX_BASE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attPkxBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_PKX_BASE
- </select>
- <select id="findList" resultMap="attPkxBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_PKX_BASE
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from ATT_PKX_BASE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttPkxBase">
- insert into ATT_PKX_BASE(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_PKX_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttPkxBase">
- delete from ATT_PKX_BASE
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_PKX_BASE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttPkxBase">
- update ATT_PKX_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="lv != null and lv != ''">LV = #{lv},</if>
- <if test="pkfq != null and pkfq != ''">PKFQ = #{pkfq},</if>
- <if test="pw != null and pw != ''">PW = #{pw},</if>
- <if test="zdx != null and zdx != ''">ZDX = #{zdx},</if>
- <if test="sdpk != null and sdpk != ''">SDPK = #{sdpk},</if>
- <if test="sqsz != null and sqsz != ''">SQSZ = #{sqsz},</if>
- <if test="bjx != null and bjx != ''">BJX = #{bjx},</if>
- <if test="gblq != null and gblq != ''">GBLQ = #{gblq},</if>
- <if test="mzx != null and mzx != ''">MZX = #{mzx},</if>
- <if test="zysq != null and zysq != ''">ZYSQ = #{zysq},</if>
- <if test="tcx != null and tcx != ''">TCX = #{tcx},</if>
- <if test="ddfp != null and ddfp != ''">DDFP = #{ddfp},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttPkxBase">
- update ATT_PKX_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="lv != null and lv != ''">LV = #{lv},</if>
- <if test="pkfq != null and pkfq != ''">PKFQ = #{pkfq},</if>
- <if test="pw != null and pw != ''">PW = #{pw},</if>
- <if test="zdx != null and zdx != ''">ZDX = #{zdx},</if>
- <if test="sdpk != null and sdpk != ''">SDPK = #{sdpk},</if>
- <if test="sqsz != null and sqsz != ''">SQSZ = #{sqsz},</if>
- <if test="bjx != null and bjx != ''">BJX = #{bjx},</if>
- <if test="gblq != null and gblq != ''">GBLQ = #{gblq},</if>
- <if test="mzx != null and mzx != ''">MZX = #{mzx},</if>
- <if test="zysq != null and zysq != ''">ZYSQ = #{zysq},</if>
- <if test="tcx != null and tcx != ''">TCX = #{tcx},</if>
- <if test="ddfp != null and ddfp != ''">DDFP = #{ddfp},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="findListBy" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
- resultType="cn.com.goldenwater.dcproj.model.AttPkxBase">
- select f.CODE,
- f.NAME,
- f.LV,
- f.PKFQ,
- f.PW,
- f.ZDX,
- f.SDPK,
- f.SQSZ,
- f.BJX,
- f.GBLQ,
- f.MZX,
- f.ZYSQ,
- f.TCX,
- f.DDFP from (
- select t.CODE,
- t.NAME,
- t.LV,
- t.PKFQ,
- t.PW,
- t.ZDX,
- t.SDPK,
- t.SQSZ,
- t.BJX,
- t.GBLQ,
- t.MZX,
- t.ZYSQ,
- t.TCX,
- t.DDFP,x.lgtd,x.lttd from ATT_PKX_BASE t left join ATT_AD_X_BASE x on t.code = x.ad_code
- ) f where 1=1
- <if test="adName != null and adName != ''">
- and f.name like '%${adName}%'
- </if>
- <if test="adCode != null and adCode != ''">
- and f.CODE like '${adCode}%'
- </if>
- <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and f.lgtd BETWEEN #{minLgtd}
- AND #{maxLgtd}
- </if>
- <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and f.lttd BETWEEN #{minLttd}
- AND #{maxLttd}
- </if>
- <if test="lv != null and lv != ''">
- and f.LV = #{lv}
- </if>
- </select>
- </mapper>
|