123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?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.pssr.mapper.TPssrNitrogenMapper">
-
- <resultMap type="TPssrNitrogen" id="TPssrNitrogenResult">
- <result property="id" column="id" />
- <result property="subId" column="sub_id" />
- <result property="approveId" column="approve_id" />
- <result property="systemName" column="system_name" />
- <result property="samplingDate" column="sampling_date" />
- <result property="sampleName" column="sample_name" />
- <result property="oxygen" column="oxygen" />
- <result property="standard" column="standard" />
- <result property="confirm1" column="confirm1" />
- <result property="confirm2" column="confirm2" />
- <result property="confirmationDate" column="confirmation_date" />
- <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="deptId" column="dept_id" />
- <result property="remarks" column="remarks" />
- <result property="approveStatus" column="approve_status" />
- <result property="deptName" column="dept_name" />
- <result property="confirm1Name" column="confirm1_name" />
- <result property="confirm2Name" column="confirm2_name" />
- </resultMap>
- <sql id="selectTPssrNitrogenVo">
- select d.id, u1.nick_name confirm1_name, u2.nick_name confirm2_name, d.sub_id, d.approve_id, d.system_name, d.sampling_date, d.sample_name, d.oxygen, d.standard, d.confirm1, d.confirm2, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_nitrogen d
- left join sys_dept s on s.dept_id = d.dept_id
- left join sys_user u1 on u1.user_id = d.CONFIRM1
- left join sys_user u2 on u2.user_id = d.CONFIRM2
- </sql>
- <select id="selectTPssrNitrogenList" parameterType="TPssrNitrogen" resultMap="TPssrNitrogenResult">
- <include refid="selectTPssrNitrogenVo"/>
- <where>
- <if test="subId != null "> and sub_id = #{subId}</if>
- <if test="approveId != null "> and approve_id = #{approveId}</if>
- <if test="systemName != null and systemName != ''"> and system_name like concat(concat('%', #{systemName}), '%')</if>
- <if test="samplingDate != null and samplingDate != ''"> and sampling_date = #{samplingDate}</if>
- <if test="sampleName != null and sampleName != ''"> and sample_name like concat(concat('%', #{sampleName}), '%')</if>
- <if test="oxygen != null and oxygen != ''"> and oxygen = #{oxygen}</if>
- <if test="standard != null and standard != ''"> and standard = #{standard}</if>
- <if test="confirm1 != null and confirm1 != ''"> and confirm1 = #{confirm1}</if>
- <if test="confirm2 != null and confirm2 != ''"> and confirm2 = #{confirm2}</if>
- <if test="confirmationDate != null "> and confirmation_date = #{confirmationDate}</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="deptId != null "> and dept_id = #{deptId}</if>
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
-
- <select id="selectTPssrNitrogenById" parameterType="Long" resultMap="TPssrNitrogenResult">
- <include refid="selectTPssrNitrogenVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertTPssrNitrogen" parameterType="TPssrNitrogen">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_pssr_nitrogen.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_pssr_nitrogen
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="subId != null">sub_id,</if>
- <if test="approveId != null">approve_id,</if>
- <if test="systemName != null">system_name,</if>
- <if test="samplingDate != null">sampling_date,</if>
- <if test="sampleName != null">sample_name,</if>
- <if test="oxygen != null">oxygen,</if>
- <if test="standard != null">standard,</if>
- <if test="confirm1 != null">confirm1,</if>
- <if test="confirm2 != null">confirm2,</if>
- <if test="confirmationDate != null">confirmation_date,</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="deptId != null">dept_id,</if>
- <if test="remarks != null">remarks,</if>
- <if test="approveStatus != null">approve_status,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="subId != null">#{subId},</if>
- <if test="approveId != null">#{approveId},</if>
- <if test="systemName != null">#{systemName},</if>
- <if test="samplingDate != null">#{samplingDate},</if>
- <if test="sampleName != null">#{sampleName},</if>
- <if test="oxygen != null">#{oxygen},</if>
- <if test="standard != null">#{standard},</if>
- <if test="confirm1 != null">#{confirm1},</if>
- <if test="confirm2 != null">#{confirm2},</if>
- <if test="confirmationDate != null">#{confirmationDate},</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="deptId != null">#{deptId},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="approveStatus != null">#{approveStatus},</if>
- </trim>
- </insert>
- <update id="updateTPssrNitrogen" parameterType="TPssrNitrogen">
- update t_pssr_nitrogen
- <trim prefix="SET" suffixOverrides=",">
- <if test="subId != null">sub_id = #{subId},</if>
- <if test="approveId != null">approve_id = #{approveId},</if>
- <if test="systemName != null">system_name = #{systemName},</if>
- <if test="samplingDate != null">sampling_date = #{samplingDate},</if>
- <if test="sampleName != null">sample_name = #{sampleName},</if>
- <if test="oxygen != null">oxygen = #{oxygen},</if>
- <if test="standard != null">standard = #{standard},</if>
- <if test="confirm1 != null">confirm1 = #{confirm1},</if>
- <if test="confirm2 != null">confirm2 = #{confirm2},</if>
- <if test="confirmationDate != null">confirmation_date = #{confirmationDate},</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="deptId != null">dept_id = #{deptId},</if>
- <if test="remarks != null">remarks = #{remarks},</if>
- <if test="approveStatus != null">approve_status = #{approveStatus},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTPssrNitrogenById" parameterType="Long">
- update t_pssr_nitrogen set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTPssrNitrogenByIds" parameterType="String">
- update t_pssr_nitrogen set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
-
- </mapper>
|