|
@@ -0,0 +1,128 @@
|
|
|
|
+<?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.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionInspectMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="CenterdataTHousingconstructionInspect" id="CenterdataTHousingconstructionInspectResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
+ <result property="createName" column="create_name" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
+ <result property="updateName" column="update_name" />
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
|
+ <result property="steelcylinderId" column="steelcylinder_id" />
|
|
|
|
+ <result property="steelcylinderName" column="steelcylinder_name" />
|
|
|
|
+ <result property="inspectTime" column="inspect_time" />
|
|
|
|
+ <result property="state" column="state" />
|
|
|
|
+ <result property="address" column="address" />
|
|
|
|
+ <result property="nextInspectTime" column="next_inspect_time" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectCenterdataTHousingconstructionInspectVo">
|
|
|
|
+ select a.id, a.create_by, a.create_name, a.create_time, a.update_by, a.update_name, a.update_time, a.dept_id, a.dept_name, a.steelcylinder_id,
|
|
|
|
+ a.steelcylinder_name, a.inspect_time, a.state, a.address, a.next_inspect_time from centerdata_t_housingconstruction_inspect a
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectCenterdataTHousingconstructionInspectList" parameterType="CenterdataTHousingconstructionInspect" resultMap="CenterdataTHousingconstructionInspectResult">
|
|
|
|
+ <include refid="selectCenterdataTHousingconstructionInspectVo"/>
|
|
|
|
+ left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
|
|
|
|
+ <if test="updateName != null and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</if>
|
|
|
|
+ <if test="steelcylinderId != null and steelcylinderId != ''"> and steelcylinder_id = #{steelcylinderId}</if>
|
|
|
|
+ <if test="steelcylinderName != null and steelcylinderName != ''"> and steelcylinder_name like concat('%', #{steelcylinderName}, '%')</if>
|
|
|
|
+ <if test="inspectTime != null "> and inspect_time = #{inspectTime}</if>
|
|
|
|
+ <if test="state != null and state != ''"> and state = #{state}</if>
|
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
|
+ <if test="nextInspectTime != null "> and next_inspect_time = #{nextInspectTime}</if>
|
|
|
|
+ <if test="deptId != null">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="deptName != null and deptName == 0">
|
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>and d.dept_id = #{deptId}</otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </if>
|
|
|
|
+ ${params.dataScope}
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectCenterdataTHousingconstructionInspectById" parameterType="String" resultMap="CenterdataTHousingconstructionInspectResult">
|
|
|
|
+ <include refid="selectCenterdataTHousingconstructionInspectVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertCenterdataTHousingconstructionInspect" parameterType="CenterdataTHousingconstructionInspect">
|
|
|
|
+ insert into centerdata_t_housingconstruction_inspect
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null and id != ''">id,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createName != null">create_name,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateName != null">update_name,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
|
+ <if test="steelcylinderId != null">steelcylinder_id,</if>
|
|
|
|
+ <if test="steelcylinderName != null">steelcylinder_name,</if>
|
|
|
|
+ <if test="inspectTime != null">inspect_time,</if>
|
|
|
|
+ <if test="state != null">state,</if>
|
|
|
|
+ <if test="address != null">address,</if>
|
|
|
|
+ <if test="nextInspectTime != null">next_inspect_time,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null and id != ''">#{id},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createName != null">#{createName},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateName != null">#{updateName},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
|
+ <if test="steelcylinderId != null">#{steelcylinderId},</if>
|
|
|
|
+ <if test="steelcylinderName != null">#{steelcylinderName},</if>
|
|
|
|
+ <if test="inspectTime != null">#{inspectTime},</if>
|
|
|
|
+ <if test="state != null">#{state},</if>
|
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
|
+ <if test="nextInspectTime != null">#{nextInspectTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateCenterdataTHousingconstructionInspect" parameterType="CenterdataTHousingconstructionInspect">
|
|
|
|
+ update centerdata_t_housingconstruction_inspect
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
+ <if test="createName != null">create_name = #{createName},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateName != null">update_name = #{updateName},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
|
+ <if test="steelcylinderId != null">steelcylinder_id = #{steelcylinderId},</if>
|
|
|
|
+ <if test="steelcylinderName != null">steelcylinder_name = #{steelcylinderName},</if>
|
|
|
|
+ <if test="inspectTime != null">inspect_time = #{inspectTime},</if>
|
|
|
|
+ <if test="state != null">state = #{state},</if>
|
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
|
+ <if test="nextInspectTime != null">next_inspect_time = #{nextInspectTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteCenterdataTHousingconstructionInspectById" parameterType="String">
|
|
|
|
+ delete from centerdata_t_housingconstruction_inspect where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteCenterdataTHousingconstructionInspectByIds" parameterType="String">
|
|
|
|
+ delete from centerdata_t_housingconstruction_inspect where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|