123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- <?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.steerinfo.ems.foldthevalues.mapper.FoldTheValuesMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
- <id column="ID" jdbcType="VARCHAR" property="id" />
- <result column="MATERIALSOURCE" jdbcType="VARCHAR" property="materialsource" />
- <result column="CLOCK" jdbcType="VARCHAR" property="clock" />
- <result column="CODE" jdbcType="VARCHAR" property="code" />
- <result column="DESCRIPTION" jdbcType="VARCHAR" property="description" />
- <result column="ISAVAILABLE" jdbcType="VARCHAR" property="isavailable" />
- <result column="REVISOR" jdbcType="VARCHAR" property="revisor" />
- <result column="REVISETIME" jdbcType="VARCHAR" property="revisetime" />
- <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
- <result column="BZ" jdbcType="VARCHAR" property="bz" />
- <result column="MATERIALNO" jdbcType="VARCHAR" property="materialno"/>
- </resultMap>
- <sql id="columns">
- ID, MATERIALSOURCE, CLOCK, CODE, DESCRIPTION, ISAVAILABLE, REVISOR, REVISETIME,
- UNITID, BZ,MATERIALNO
- </sql>
- <sql id="columns_alias">
- t.ID, t.MATERIALSOURCE, t.CLOCK, t.CODE, t.DESCRIPTION, t.ISAVAILABLE, t.REVISOR,
- t.REVISETIME, t.UNITID, t.BZ,t.MATERIALNO
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM FOLD_THE_VALUES
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM FOLD_THE_VALUES t
- </sql>
- <sql id="where">
- <where>
- <if test="id != null and id != ''">
- and ID = #{id}
- </if>
- <if test="materialsource != null and materialsource != ''">
- and MATERIALSOURCE = #{materialsource}
- </if>
- <if test="clock != null and clock != ''">
- and CLOCK = #{clock}
- </if>
- <if test="code != null and code != ''">
- and CODE = #{code}
- </if>
- <if test="description != null and description != ''">
- and DESCRIPTION = #{description}
- </if>
- <if test="isavailable != null and isavailable != ''">
- and ISAVAILABLE = #{isavailable}
- </if>
- <if test="revisor != null and revisor != ''">
- and REVISOR = #{revisor}
- </if>
- <if test="revisetime != null and revisetime != ''">
- and REVISETIME = #{revisetime}
- </if>
- <if test="unitid != null and unitid != ''">
- and UNITID = #{unitid}
- </if>
- <if test="bz != null and bz != ''">
- and BZ = #{bz}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="id != null and id != ''">
- and ID LIKE '%${id}%'
- </if>
- <if test="materialsource != null and materialsource != ''">
- and MATERIALSOURCE LIKE '%${materialsource}%'
- </if>
- <if test="clock != null and clock != ''">
- and CLOCK LIKE '%${clock}%'
- </if>
- <if test="code != null and code != ''">
- and CODE LIKE '%${code}%'
- </if>
- <if test="description != null and description != ''">
- and DESCRIPTION LIKE '%${description}%'
- </if>
- <if test="isavailable != null and isavailable != ''">
- and ISAVAILABLE LIKE '%${isavailable}%'
- </if>
- <if test="revisor != null and revisor != ''">
- and REVISOR LIKE '%${revisor}%'
- </if>
- <if test="revisetime != null and revisetime != ''">
- and REVISETIME LIKE '%${revisetime}%'
- </if>
- <if test="unitid != null and unitid != ''">
- and UNITID LIKE '%${unitid}%'
- </if>
- <if test="bz != null and bz != ''">
- and BZ LIKE '%${bz}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from FOLD_THE_VALUES
- where ID = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from FOLD_THE_VALUES
- where 1!=1
- <if test="materialsource != null and materialsource != ''">
- or MATERIALSOURCE = #{materialsource}
- </if>
- <if test="clock != null and clock != ''">
- or CLOCK = #{clock}
- </if>
- <if test="code != null and code != ''">
- or CODE = #{code}
- </if>
- <if test="description != null and description != ''">
- or DESCRIPTION = #{description}
- </if>
- <if test="isavailable != null and isavailable != ''">
- or ISAVAILABLE = #{isavailable}
- </if>
- <if test="revisor != null and revisor != ''">
- or REVISOR = #{revisor}
- </if>
- <if test="revisetime != null and revisetime != ''">
- or REVISETIME = #{revisetime}
- </if>
- <if test="unitid != null and unitid != ''">
- or UNITID = #{unitid}
- </if>
- <if test="bz != null and bz != ''">
- or BZ = #{bz}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
- insert into FOLD_THE_VALUES (ID, MATERIALSOURCE, CLOCK,
- CODE, DESCRIPTION, ISAVAILABLE,
- REVISOR, REVISETIME,MATERIALNO,
- UNITID, BZ)
- values (#{id,jdbcType=VARCHAR}, #{materialsource,jdbcType=VARCHAR}, #{clock,jdbcType=VARCHAR},
- #{code,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{isavailable,jdbcType=VARCHAR},
- #{revisor,jdbcType=VARCHAR}, #{revisetime,jdbcType=VARCHAR},#{materialno,jdbcType=VARCHAR},
- #{unitid,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
- insert into FOLD_THE_VALUES
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- ID,
- </if>
- <if test="materialsource != null">
- MATERIALSOURCE,
- </if>
- <if test="clock != null">
- CLOCK,
- </if>
- <if test="code != null">
- CODE,
- </if>
- <if test="description != null">
- DESCRIPTION,
- </if>
- <if test="isavailable != null">
- ISAVAILABLE,
- </if>
- <if test="revisor != null">
- REVISOR,
- </if>
- <if test="revisetime != null">
- REVISETIME,
- </if>
- <if test="unitid != null">
- UNITID,
- </if>
- <if test="bz != null">
- BZ,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="materialsource != null">
- #{materialsource,jdbcType=VARCHAR},
- </if>
- <if test="clock != null">
- #{clock,jdbcType=VARCHAR},
- </if>
- <if test="code != null">
- #{code,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- #{description,jdbcType=VARCHAR},
- </if>
- <if test="isavailable != null">
- #{isavailable,jdbcType=VARCHAR},
- </if>
- <if test="revisor != null">
- #{revisor,jdbcType=VARCHAR},
- </if>
- <if test="revisetime != null">
- #{revisetime,jdbcType=VARCHAR},
- </if>
- <if test="unitid != null">
- #{unitid,jdbcType=VARCHAR},
- </if>
- <if test="bz != null">
- #{bz,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
- update FOLD_THE_VALUES
- set
- CLOCK = #{clock,jdbcType=VARCHAR},
- CODE = #{code,jdbcType=VARCHAR},
- DESCRIPTION = #{description,jdbcType=VARCHAR},
- ISAVAILABLE = #{isavailable,jdbcType=VARCHAR},
- REVISOR = #{revisor,jdbcType=VARCHAR},
- REVISETIME = #{revisetime,jdbcType=VARCHAR},
- UNITID = #{unitid,jdbcType=VARCHAR},
- BZ = #{bz,jdbcType=VARCHAR}
- where ID = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.foldthevalues.model.FoldTheValues">
- update FOLD_THE_VALUES
- <set>
- <if test="materialsource != null">
- MATERIALSOURCE = #{materialsource,jdbcType=VARCHAR},
- </if>
- <if test="clock != null">
- CLOCK = #{clock,jdbcType=VARCHAR},
- </if>
- <if test="code != null">
- CODE = #{code,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- DESCRIPTION = #{description,jdbcType=VARCHAR},
- </if>
- <if test="isavailable != null">
- ISAVAILABLE = #{isavailable,jdbcType=VARCHAR},
- </if>
- <if test="revisor != null">
- REVISOR = #{revisor,jdbcType=VARCHAR},
- </if>
- <if test="revisetime != null">
- REVISETIME = #{revisetime,jdbcType=VARCHAR},
- </if>
- <if test="unitid != null">
- UNITID = #{unitid,jdbcType=VARCHAR},
- </if>
- <if test="bz != null">
- BZ = #{bz,jdbcType=VARCHAR},
- </if>
- </set>
- where ID = #{id,jdbcType=VARCHAR}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <include refid="select"/>
- where ID = #{id,jdbcType=VARCHAR}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into FOLD_THE_VALUES
- (ID,
- MATERIALSOURCE, CLOCK, CODE,
- DESCRIPTION, ISAVAILABLE, REVISOR,
- REVISETIME, UNITID,
- BZ)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.id,jdbcType=VARCHAR},
- #{item.materialsource,jdbcType=VARCHAR}, #{item.clock,jdbcType=VARCHAR}, #{item.code,jdbcType=VARCHAR},
- #{item.description,jdbcType=VARCHAR}, #{item.isavailable,jdbcType=VARCHAR}, #{item.revisor,jdbcType=VARCHAR},
- #{item.revisetime,jdbcType=VARCHAR}, #{item.unitid,jdbcType=VARCHAR},
- #{item.bz,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update FOLD_THE_VALUES
- set
- ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
- </foreach>
- ,MATERIALSOURCE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.materialsource,jdbcType=VARCHAR}
- </foreach>
- ,CLOCK=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.clock,jdbcType=VARCHAR}
- </foreach>
- ,CODE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.code,jdbcType=VARCHAR}
- </foreach>
- ,DESCRIPTION=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.description,jdbcType=VARCHAR}
- </foreach>
- ,ISAVAILABLE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.isavailable,jdbcType=VARCHAR}
- </foreach>
- ,REVISOR=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.revisor,jdbcType=VARCHAR}
- </foreach>
- ,REVISETIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.revisetime,jdbcType=VARCHAR}
- </foreach>
- ,UNITID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.unitid,jdbcType=VARCHAR}
- </foreach>
- ,BZ=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
- </foreach>
- where ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.id,jdbcType=VARCHAR}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from FOLD_THE_VALUES
- where ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="getDateForPage" parameterType="java.util.HashMap" resultType="Map">
- select t.*, t1.id as energyid, t1.name as energyname
- from Fold_the_values t
- left join t_rm_energy t1
- on t.materialno = t1.bdesc1
- <where>
- <if test="clock != null and clock != '' ">
- and t.clock = #{clock}
- </if>
- <if test="energyid != null and energyid != '' ">
- and t1.energyid = #{energyid}
- </if>
- </where>
- </select>
- </mapper>
|