| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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.ps.dev.mapper.TPsDevRainvalveMapper">
-
- <resultMap type="TPsDevRainvalve" id="TPsDevRainvalveResult">
- <result property="id" column="id" />
- <result property="position" column="position" />
- <result property="valveName" column="valve_name" />
- <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="status" column="status" />
- <result property="patrolType" column="patrol_type" />
- <result property="deptName" column="dept_name" />
- </resultMap>
- <sql id="selectTPsDevRainvalveVo">
- select d.id, d.position, d.valve_name, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.status, d.patrol_type ,s.dept_name from t_ps_dev_rainvalve d
- left join sys_dept s on s.dept_id = d.dept_id
- </sql>
- <select id="selectTPsDevRainvalveList" parameterType="TPsDevRainvalve" resultMap="TPsDevRainvalveResult">
- <include refid="selectTPsDevRainvalveVo"/>
- <where>
- <if test="position != null and position != ''"> and position = #{position}</if>
- <if test="valveName != null and valveName != ''"> and valve_name like concat(concat('%', #{valveName}), '%')</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="status != null and status != ''"> and d.status = #{status}</if>
- <if test="patrolType != null and patrolType != ''"> and patrol_type = #{patrolType}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
-
- <select id="selectTPsDevRainvalveById" parameterType="Long" resultMap="TPsDevRainvalveResult">
- <include refid="selectTPsDevRainvalveVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertTPsDevRainvalve" parameterType="TPsDevRainvalve">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_ps_dev_rainvalve.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_ps_dev_rainvalve
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="position != null">position,</if>
- <if test="valveName != null">valve_name,</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="status != null">status,</if>
- <if test="patrolType != null">patrol_type,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="position != null">#{position},</if>
- <if test="valveName != null">#{valveName},</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="status != null">#{status},</if>
- <if test="patrolType != null">#{patrolType},</if>
- </trim>
- </insert>
- <update id="updateTPsDevRainvalve" parameterType="TPsDevRainvalve">
- update t_ps_dev_rainvalve
- <trim prefix="SET" suffixOverrides=",">
- <if test="position != null">position = #{position},</if>
- <if test="valveName != null">valve_name = #{valveName},</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="status != null">status = #{status},</if>
- <if test="patrolType != null">patrol_type = #{patrolType},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTPsDevRainvalveById" parameterType="Long">
- update t_ps_dev_rainvalve set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTPsDevRainvalveByIds" parameterType="String">
- update t_ps_dev_rainvalve set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
-
- </mapper>
|