| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <?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.gov.customs.wxjy.base.dao.ChemicalsCatalogMapper">
- <resultMap type="ChemicalsCatalog" id="ChemicalsCatalogResult">
- <result property="id" column="ID"/>
- <result property="dangerName" column="DANGER_NAME"/>
- <result property="enName" column="EN_NAME"/>
- <result property="chAlias" column="CH_ALIAS"/>
- <result property="enAlias" column="EN_ALIAS"/>
- <result property="chemicalsEq" column="CHEMICALS_EQ"/>
- <result property="cas" column="CAS"/>
- <result property="unCode" column="UN_CODE"/>
- <result property="dangerStatement" column="DANGER_STATEMENT"/>
- <result property="preventStatement" column="PREVENT_STATEMENT"/>
- <result property="chSignalWord" column="CH_SIGNAL_WORD"/>
- <result property="enSignalWord" column="EN_SIGNAL_WORD"/>
- <result property="signs" column="SIGNS"/>
- <result property="remark" column="REMARK"/>
- <result property="createUser" column="CREATE_USER"/>
- <result property="createDept" column="CREATE_DEPT"/>
- <result property="createTime" column="CREATE_TIME"/>
- <result property="updateUser" column="UPDATE_USER"/>
- <result property="updateTime" column="UPDATE_TIME"/>
- <result property="isDeleted" column="IS_DELETED"/>
- <result property="status" column="STATUS"/>
- <result property="indexNum" column="INDEX_NUM"/>
- </resultMap>
- <sql id="baseVo">
- select ID, DANGER_NAME, EN_NAME, CH_ALIAS, EN_ALIAS, CHEMICALS_EQ, CAS, UN_CODE, DANGER_STATEMENT, PREVENT_STATEMENT, CH_SIGNAL_WORD, EN_SIGNAL_WORD, SIGNS, REMARK, CREATE_USER, CREATE_DEPT, CREATE_TIME, UPDATE_USER, UPDATE_TIME, IS_DELETED, STATUS, INDEX_NUM
- from WXJY_CHEMICALS_CATALOG
- </sql>
- <select id="selectList" parameterType="ChemicalsCatalogQuery" resultMap="ChemicalsCatalogResult">
- <include refid="baseVo"/>
- <where>
- and IS_DELETED = 0
- <if test="dangerName != null and dangerName != ''">
- and DANGER_NAME like concat('%', #{dangerName}, '%')
- </if>
- <if test="enName != null and enName != ''">
- and EN_NAME like concat('%', #{enName}, '%')
- </if>
- <if test="chAlias != null and chAlias != ''">
- and CH_ALIAS = #{chAlias}
- </if>
- <if test="enAlias != null and enAlias != ''">
- and EN_ALIAS = #{enAlias}
- </if>
- <if test="chemicalsEq != null and chemicalsEq != ''">
- and CHEMICALS_EQ = #{chemicalsEq}
- </if>
- <if test="cas != null and cas != ''">
- and CAS like concat('%', #{cas}, '%')
- </if>
- <if test="unCode != null and unCode != ''">
- and UN_CODE = #{unCode}
- </if>
- <if test="dangerStatement != null and dangerStatement != ''">
- and DANGER_STATEMENT = #{dangerStatement}
- </if>
- <if test="preventStatement != null and preventStatement != ''">
- and PREVENT_STATEMENT = #{preventStatement}
- </if>
- <if test="chSignalWord != null and chSignalWord != ''">
- and CH_SIGNAL_WORD = #{chSignalWord}
- </if>
- <if test="enSignalWord != null and enSignalWord != ''">
- and EN_SIGNAL_WORD = #{enSignalWord}
- </if>
- <if test="signs != null and signs != ''">
- and SIGNS = #{signs}
- </if>
- <if test="remark != null and remark != ''">
- and REMARK = #{remark}
- </if>
- <if test="createUser != null and createUser != ''">
- and CREATE_USER = #{createUser}
- </if>
- <if test="createDept != null and createDept != ''">
- and CREATE_DEPT = #{createDept}
- </if>
- <if test="createTime != null and createTime != ''">
- and CREATE_TIME = #{createTime}
- </if>
- <if test="updateUser != null and updateUser != ''">
- and UPDATE_USER = #{updateUser}
- </if>
- <if test="updateTime != null ">
- and UPDATE_TIME >= #{updateTime}
- </if>
- <if test="isDeleted != null and isDeleted != ''">
- and IS_DELETED = #{isDeleted}
- </if>
- <if test="status != null and status != ''">
- and STATUS = #{status}
- </if>
- <if test="indexNum != null and indexNum != ''">
- and INDEX_NUM = #{indexNum}
- </if>
- </where>
- order by update_time desc
- </select>
- <select id="selectByID" parameterType="String"
- resultMap="ChemicalsCatalogResult">
- <include refid="baseVo"/>
- where ID = #{ID}
- </select>
- <insert id="insert" parameterType="ChemicalsCatalog">
- insert into WXJY_CHEMICALS_CATALOG
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">id,
- </if>
- <if test="dangerName != null">DANGER_NAME,
- </if>
- <if test="enName != null">EN_NAME,
- </if>
- <if test="chAlias != null">CH_ALIAS,
- </if>
- <if test="enAlias != null">EN_ALIAS,
- </if>
- <if test="chemicalsEq != null">CHEMICALS_EQ,
- </if>
- <if test="cas != null">CAS,
- </if>
- <if test="unCode != null">UN_CODE,
- </if>
- <if test="dangerStatement != null">DANGER_STATEMENT,
- </if>
- <if test="preventStatement != null">PREVENT_STATEMENT,
- </if>
- <if test="chSignalWord != null">CH_SIGNAL_WORD,
- </if>
- <if test="enSignalWord != null">EN_SIGNAL_WORD,
- </if>
- <if test="signs != null">SIGNS,
- </if>
- <if test="remark != null">REMARK,
- </if>
- <if test="createUser != null">CREATE_USER,
- </if>
- <if test="createDept != null">CREATE_DEPT,
- </if>
- <if test="createTime != null">CREATE_TIME,
- </if>
- <if test="updateUser != null">UPDATE_USER,
- </if>
- <if test="updateTime != null">UPDATE_TIME,
- </if>
- <if test="isDeleted != null">IS_DELETED,
- </if>
- <if test="status != null">STATUS,
- </if>
- <if test="indexNum != null">INDEX_NUM,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">#{id},
- </if>
- <if test="dangerName != null">#{dangerName},
- </if>
- <if test="enName != null">#{enName},
- </if>
- <if test="chAlias != null">#{chAlias},
- </if>
- <if test="enAlias != null">#{enAlias},
- </if>
- <if test="chemicalsEq != null">#{chemicalsEq},
- </if>
- <if test="cas != null">#{cas},
- </if>
- <if test="unCode != null">#{unCode},
- </if>
- <if test="dangerStatement != null">#{dangerStatement},
- </if>
- <if test="preventStatement != null">#{preventStatement},
- </if>
- <if test="chSignalWord != null">#{chSignalWord},
- </if>
- <if test="enSignalWord != null">#{enSignalWord},
- </if>
- <if test="signs != null">#{signs},
- </if>
- <if test="remark != null">#{remark},
- </if>
- <if test="createUser != null">#{createUser},
- </if>
- <if test="createDept != null">#{createDept},
- </if>
- <if test="createTime != null">#{createTime},
- </if>
- <if test="updateUser != null">#{updateUser},
- </if>
- <if test="updateTime != null">#{updateTime},
- </if>
- <if test="isDeleted != null">#{isDeleted},
- </if>
- <if test="status != null">#{status},
- </if>
- <if test="indexNum != null">#{indexNum},
- </if>
- </trim>
- </insert>
- <update id="update" parameterType="ChemicalsCatalog">
- update WXJY_CHEMICALS_CATALOG
- <trim prefix="SET" suffixOverrides=",">
- <if test="dangerName != null">DANGER_NAME =
- #{dangerName},
- </if>
- <if test="enName != null">EN_NAME =
- #{enName},
- </if>
- <if test="chAlias != null">CH_ALIAS =
- #{chAlias},
- </if>
- <if test="enAlias != null">EN_ALIAS =
- #{enAlias},
- </if>
- <if test="chemicalsEq != null">CHEMICALS_EQ =
- #{chemicalsEq},
- </if>
- <if test="cas != null">CAS =
- #{cas},
- </if>
- <if test="unCode != null">UN_CODE =
- #{unCode},
- </if>
- <if test="dangerStatement != null">DANGER_STATEMENT =
- #{dangerStatement},
- </if>
- <if test="preventStatement != null">PREVENT_STATEMENT =
- #{preventStatement},
- </if>
- <if test="chSignalWord != null">CH_SIGNAL_WORD =
- #{chSignalWord},
- </if>
- <if test="enSignalWord != null">EN_SIGNAL_WORD =
- #{enSignalWord},
- </if>
- <if test="signs != null">SIGNS =
- #{signs},
- </if>
- <if test="remark != null">REMARK =
- #{remark},
- </if>
- <if test="createUser != null">CREATE_USER =
- #{createUser},
- </if>
- <if test="createDept != null">CREATE_DEPT =
- #{createDept},
- </if>
- <if test="createTime != null">CREATE_TIME =
- #{createTime},
- </if>
- <if test="updateUser != null">UPDATE_USER =
- #{updateUser},
- </if>
- <if test="updateTime != null">UPDATE_TIME =
- #{updateTime},
- </if>
- <if test="isDeleted != null">IS_DELETED =
- #{isDeleted},
- </if>
- <if test="status != null">STATUS =
- #{status},
- </if>
- <if test="indexNum != null">INDEX_NUM =
- #{indexNum},
- </if>
- </trim>
- where ID = #{id}
- </update>
- <delete id="deleteByID" parameterType="String">
- delete
- from WXJY_CHEMICALS_CATALOG where ID = #{id}
- </delete>
- <delete id="deleteByIDs" parameterType="String">
- delete from WXJY_CHEMICALS_CATALOG where ID in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="logicDelete" parameterType="String">
- update WXJY_CHEMICALS_CATALOG set is_del = 1 where ID = #{id}
- </delete>
- </mapper>
|