123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <?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.inspection.mapper.TInspectionRecordMapper">
-
- <resultMap type="TInspectionRecord" id="TInspectionRecordResult">
- <result property="id" column="id" />
- <result property="devname" column="devname" />
- <result property="devno" column="devno" />
- <result property="region" column="region" />
- <result property="reason" column="reason" />
- <result property="inspectionTime" column="inspection_time" />
- <result property="pastTime" column="past_time" />
- <result property="pasterCode" column="paster_code" />
- <result property="treatment" column="treatment" />
- <result property="deptId" column="dept_id" />
- <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="deptName" column="dept_name" />
- <result property="regionId" column="region_id" />
- </resultMap>
- <sql id="selectTInspectionRecordVo">
- select d.id, d.devname, d.devno, d.region, d.reason, d.inspection_time, d.past_time, d.paster_code, d.treatment, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks ,d.region_id,s.dept_name from t_inspection_record d
- left join sys_dept s on s.dept_id = d.dept_id
- </sql>
- <select id="selectTInspectionRecordList" parameterType="TInspectionRecord" resultMap="TInspectionRecordResult">
- <include refid="selectTInspectionRecordVo"/>
- <where>
- <if test="devname != null and devname != ''"> and devname like concat(concat('%', #{devname}), '%')</if>
- <if test="devno != null and devno != ''"> and devno = #{devno}</if>
- <if test="region != null and region != ''"> and region = #{region}</if>
- <if test="reason != null and reason != ''"> and reason = #{reason}</if>
- <if test="inspectionTime != null "> and inspection_time = #{inspectionTime}</if>
- <if test="pastTime != null "> and past_time = #{pastTime}</if>
- <if test="pasterCode != null and pasterCode != ''"> and paster_code = #{pasterCode}</if>
- <if test="treatment != null and treatment != ''"> and treatment = #{treatment}</if>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
- <if test="createdate != null "> and createdate = #{createdate}</if>
- <if test="createyear != null "> and to_char(createdate,'yyyy')= #{createyear}</if>
- <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
- <if test="updatedate != null "> and updatedate = #{updatedate}</if>
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
-
- <select id="selectTInspectionRecordById" parameterType="Long" resultMap="TInspectionRecordResult">
- <include refid="selectTInspectionRecordVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertTInspectionRecord" parameterType="TInspectionRecord">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_inspection_record.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_inspection_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="devname != null">devname,</if>
- <if test="devno != null">devno,</if>
- <if test="region != null">region,</if>
- <if test="reason != null">reason,</if>
- <if test="inspectionTime != null">inspection_time,</if>
- <if test="pastTime != null">past_time,</if>
- <if test="pasterCode != null">paster_code,</if>
- <if test="treatment != null">treatment,</if>
- <if test="deptId != null">dept_id,</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="regionId != null">region_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="devname != null">#{devname},</if>
- <if test="devno != null">#{devno},</if>
- <if test="region != null">#{region},</if>
- <if test="reason != null">#{reason},</if>
- <if test="inspectionTime != null">#{inspectionTime},</if>
- <if test="pastTime != null">#{pastTime},</if>
- <if test="pasterCode != null">#{pasterCode},</if>
- <if test="treatment != null">#{treatment},</if>
- <if test="deptId != null">#{deptId},</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="regionId != null">#{regionId},</if>
- </trim>
- </insert>
- <update id="updateTInspectionRecord" parameterType="TInspectionRecord">
- update t_inspection_record
- <trim prefix="SET" suffixOverrides=",">
- <if test="devname != null">devname = #{devname},</if>
- <if test="devno != null">devno = #{devno},</if>
- <if test="region != null">region = #{region},</if>
- <if test="reason != null">reason = #{reason},</if>
- <if test="inspectionTime != null">inspection_time = #{inspectionTime},</if>
- <if test="pastTime != null">past_time = #{pastTime},</if>
- <if test="pasterCode != null">paster_code = #{pasterCode},</if>
- <if test="treatment != null">treatment = #{treatment},</if>
- <if test="deptId != null">dept_id = #{deptId},</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="regionId != null">region_id = #{regionId},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTInspectionRecordById" parameterType="Long">
- update t_inspection_record set del_flag = -1 where id = #{id}
- </update>
- <update id="deleteTInspectionRecordByIds" parameterType="String">
- update t_inspection_record set del_flag = -1 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <select id="selectByRegionId" parameterType="Long" resultMap="TInspectionRecordResult">
- <include refid="selectTInspectionRecordVo"/>
- and d.region_id = #{regionId} and d.del_flag=0
- </select>
- <update id="deleteTInspectionRecordByRegionId" parameterType="Long">
- update t_inspection_record set del_flag = -1 where region_id = #{regionId}
- </update>
- <update id="deleteTInspectionRecordByRegionIds" parameterType="String">
- update t_inspection_record set del_flag = -1 where region_id in
- <foreach item="regionId" collection="array" open="(" separator="," close=")">
- #{regionId}
- </foreach>
- </update>
- </mapper>
|