123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <?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.ruoyi.project.training.mapper.TByxWorklicenseMapper">
- <resultMap type="TByxWorklicense" id="TByxWorklicenseResult">
- <result property="id" column="id" />
- <result property="plantCode" column="plant_code" />
- <result property="name" column="name" />
- <result property="employeeid" column="employeeid" />
- <result property="classes" column="classes" />
- <result property="post" column="post" />
- <result property="idtype" column="idtype" />
- <result property="containerIdnum" column="container_idnum" />
- <result property="boiler" column="boiler" />
- <result property="container" column="container" />
- <result property="pipe" column="pipe" />
- <result property="alkylation" column="alkylation" />
- <result property="aromatic" column="aromatic" />
- <result property="recertificatedate" column="recertificatedate" />
- <result property="validity" column="validity" />
- <result property="delFlag" column="del_flag" />
- <result property="createrCode" column="creater_code" />
- <result property="createdate" column="createdate" />
- <result property="updaterCode" column="updater_code" />
- <result property="updatedate" column="updatedate" />
- <result property="remarks" column="remarks" />
- <result property="deptId" column="dept_id" />
- <result property="pipeIdnum" column="pipe_idnum" />
- <result property="alkylationIdnum" column="alkylation_idnum" />
- <result property="pipeDate" column="pipe_date" />
- <result property="alkylationDate" column="alkylation_date" />
- <result property="containerDate" column="container_date" />
- <result property="boilerIdnum" column="boiler_idnum" />
- <result property="boilerDate" column="boiler_date" />
- <result property="deptName" column="dept_name" />
- </resultMap>
- <sql id="selectTByxWorklicenseVo">
- select d.id, d.plant_code, d.name, d.employeeid, d.classes, d.post, d.idtype, d.container_idnum, d.boiler, d.container, d.pipe, d.alkylation, d.aromatic, d.recertificatedate, d.validity, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.pipe_idnum, d.alkylation_idnum, d.pipe_date, d.alkylation_date, d.container_date, d.boiler_idnum, d.boiler_date ,s.dept_name from t_byx_worklicense d
- left join sys_dept s on s.dept_id = d.dept_id
- </sql>
- <select id="selectTByxWorklicenseList" parameterType="TByxWorklicense" resultMap="TByxWorklicenseResult">
- <include refid="selectTByxWorklicenseVo"/>
- <where>
- <if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
- <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
- <if test="employeeid != null and employeeid != ''"> and employeeid = #{employeeid}</if>
- <if test="classes != null and classes != ''"> and classes = #{classes}</if>
- <if test="post != null and post != ''"> and post = #{post}</if>
- <if test="idtype != null and idtype != ''"> and idtype = #{idtype}</if>
- <if test="containerIdnum != null and containerIdnum != ''"> and container_idnum = #{containerIdnum}</if>
- <if test="boiler != null and boiler != ''"> and boiler = #{boiler}</if>
- <if test="container != null and container != ''"> and container = #{container}</if>
- <if test="pipe != null and pipe != ''"> and pipe = #{pipe}</if>
- <if test="alkylation != null and alkylation != ''"> and alkylation = #{alkylation}</if>
- <if test="aromatic != null and aromatic != ''"> and aromatic = #{aromatic}</if>
- <if test="recertificatedate != null "> and recertificatedate = #{recertificatedate}</if>
- <if test="validity != null "> and validity = #{validity}</if>
- <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
- <if test="createdate != null "> and createdate = #{createdate}</if>
- <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
- <if test="updatedate != null "> and updatedate = #{updatedate}</if>
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="pipeIdnum != null and pipeIdnum != ''"> and pipe_idnum = #{pipeIdnum}</if>
- <if test="alkylationIdnum != null and alkylationIdnum != ''"> and alkylation_idnum = #{alkylationIdnum}</if>
- <if test="pipeDate != null "> and pipe_date = #{pipeDate}</if>
- <if test="alkylationDate != null "> and alkylation_date = #{alkylationDate}</if>
- <if test="containerDate != null "> and container_date = #{containerDate}</if>
- <if test="boilerIdnum != null and boilerIdnum != ''"> and boiler_idnum = #{boilerIdnum}</if>
- <if test="boilerDate != null "> and boiler_date = #{boilerDate}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by d.id desc
- </select>
- <select id="selectList" parameterType="TByxWorklicense" resultMap="TByxWorklicenseResult">
- <include refid="selectTByxWorklicenseVo"/>
- <where>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by d.id desc
- </select>
- <select id="selectTByxWorklicenseById" parameterType="Long" resultMap="TByxWorklicenseResult">
- <include refid="selectTByxWorklicenseVo"/>
- where id = #{id}
- </select>
- <select id="selectTByxWorklicenseByEmployeeid" parameterType="String" resultMap="TByxWorklicenseResult">
- <include refid="selectTByxWorklicenseVo"/>
- where employeeid = #{employeeid}
- </select>
- <insert id="insertTByxWorklicense" parameterType="TByxWorklicense">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_byx_worklicense.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_byx_worklicense
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="plantCode != null and plantCode != ''">plant_code,</if>
- <if test="name != null">name,</if>
- <if test="employeeid != null">employeeid,</if>
- <if test="classes != null">classes,</if>
- <if test="post != null">post,</if>
- <if test="idtype != null">idtype,</if>
- <if test="containerIdnum != null">container_idnum,</if>
- <if test="boiler == 'false'">boiler,</if>
- <if test="container == 'false'">container,</if>
- <if test="pipe == 'false'">pipe,</if>
- <if test="alkylation == 'false'">alkylation,</if>
- <if test="aromatic != null">aromatic,</if>
- <if test="recertificatedate != null">recertificatedate,</if>
- <if test="validity != null">validity,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createrCode != null">creater_code,</if>
- <if test="createdate != null">createdate,</if>
- <if test="updaterCode != null">updater_code,</if>
- <if test="updatedate != null">updatedate,</if>
- <if test="remarks != null">remarks,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="pipeIdnum != null">pipe_idnum,</if>
- <if test="alkylationIdnum != null">alkylation_idnum,</if>
- <if test="pipeDate != null">pipe_date,</if>
- <if test="alkylationDate != null">alkylation_date,</if>
- <if test="containerDate != null">container_date,</if>
- <if test="boilerIdnum != null">boiler_idnum,</if>
- <if test="boilerDate != null">boiler_date,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
- <if test="name != null">#{name},</if>
- <if test="employeeid != null">#{employeeid},</if>
- <if test="classes != null">#{classes},</if>
- <if test="post != null">#{post},</if>
- <if test="idtype != null">#{idtype},</if>
- <if test="containerIdnum != null">#{containerIdnum},</if>
- <if test="boiler == 'false'">0,</if>
- <if test="container == 'false'">0,</if>
- <if test="pipe == 'false'">0,</if>
- <if test="alkylation == 'false'">0,</if>
- <if test="boiler == 'true'">1,</if>
- <if test="container == 'true'">1,</if>
- <if test="pipe == 'true'">1,</if>
- <if test="alkylation == 'true'">1,</if>
- <if test="recertificatedate != null">#{recertificatedate},</if>
- <if test="validity != null">#{validity},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createrCode != null">#{createrCode},</if>
- <if test="createdate != null">#{createdate},</if>
- <if test="updaterCode != null">#{updaterCode},</if>
- <if test="updatedate != null">#{updatedate},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="pipeIdnum != null">#{pipeIdnum},</if>
- <if test="alkylationIdnum != null">#{alkylationIdnum},</if>
- <if test="pipeDate != null">#{pipeDate},</if>
- <if test="alkylationDate != null">#{alkylationDate},</if>
- <if test="containerDate != null">#{containerDate},</if>
- <if test="boilerIdnum != null">#{boilerIdnum},</if>
- <if test="boilerDate != null">#{boilerDate},</if>
- </trim>
- </insert>
- <update id="updateTByxWorklicense" parameterType="TByxWorklicense">
- update t_byx_worklicense
- <trim prefix="SET" suffixOverrides=",">
- <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
- <if test="name != null">name = #{name},</if>
- <if test="employeeid != null">employeeid = #{employeeid},</if>
- <if test="classes != null">classes = #{classes},</if>
- <if test="post != null">post = #{post},</if>
- <if test="idtype != null">idtype = #{idtype},</if>
- <if test="containerIdnum != null">container_idnum = #{containerIdnum},</if>
- <if test="boiler == 'false'">boiler =0,</if>
- <if test="container == 'false'">container =0,</if>
- <if test="pipe == 'false'">pipe =0,</if>
- <if test="alkylation == 'false'">alkylation =0,</if>
- <if test="boiler == 'true'">boiler =1,</if>
- <if test="container == 'true'">container =1,</if>
- <if test="pipe == 'true'">pipe =1,</if>
- <if test="alkylation == 'true'">alkylation =1,</if>
- <if test="aromatic != null">aromatic = #{aromatic},</if>
- <if test="recertificatedate != null">recertificatedate = #{recertificatedate},</if>
- <if test="validity != null">validity = #{validity},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createrCode != null">creater_code = #{createrCode},</if>
- <if test="createdate != null">createdate = #{createdate},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- <if test="remarks != null">remarks = #{remarks},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="pipeIdnum != null">pipe_idnum = #{pipeIdnum},</if>
- <if test="alkylationIdnum != null">alkylation_idnum = #{alkylationIdnum},</if>
- <if test="pipeDate != null">pipe_date = #{pipeDate},</if>
- <if test="alkylationDate != null">alkylation_date = #{alkylationDate},</if>
- <if test="containerDate != null">container_date = #{containerDate},</if>
- <if test="boilerIdnum != null">boiler_idnum = #{boilerIdnum},</if>
- <if test="boilerDate != null">boiler_date = #{boilerDate},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTByxWorklicenseById" parameterType="Long">
- update t_byx_worklicense set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTByxWorklicenseByIds" parameterType="String">
- update t_byx_Worklicense set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <select id="selectLicenseData" resultType="com.ruoyi.project.common.domain.DataEntity">
- SELECT count(1) as dataNum from t_byx_worklicense
- <where>
- <if test="type == 1">
- and boiler = 1
- </if>
- <if test="type == 2">
- and container = 1
- </if>
- <if test="type == 3">
- and pipe = 1
- </if>
- <if test="type == 4">
- and alkylation = 1
- </if>
- </where>
- </select>
- </mapper>
|