<?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.tcZz.mapper.TcZdlyjgMapper" >
<resultMap type= "TcZdlyjg" id= "TcZdlyjgResult" >
<result property= "id" column= "id" />
<result property= "areaId" column= "area_id" />
<result property= "isStatus" column= "isStatus" />
<result property= "enterpriseType" column= "enterprise_type" />
<result property= "jgObgj" column= "jg_obgj" />
<result property= "jzxw" column= "jzxw" />
<result property= "jgDep" column= "jg_dep" />
<result property= "zyyj" column= "zyyj" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "remark" column= "remark" />
</resultMap>
<sql id= "selectTcZdlyjgVo" >
select id, area_id, isStatus, enterprise_type, jg_obgj, jzxw, jg_dep, zyyj, create_by, create_time, update_by, update_time, remark from tc_zdlyjg
</sql>
<select id= "selectTcZdlyjgList" parameterType= "TcZdlyjg" resultMap= "TcZdlyjgResult" >
<include refid= "selectTcZdlyjgVo" />
<where >
<if test= "id != null " > and id = #{id}</if>
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
<if test= "enterpriseType != null and enterpriseType != ''" > and enterprise_type = #{enterpriseType}</if>
<if test= "jgObgj != null and jgObgj != ''" > and jg_obgj = #{jgObgj}</if>
<if test= "jzxw != null and jzxw != ''" > and jzxw = #{jzxw}</if>
<if test= "jgDep != null and jgDep != ''" > and jg_dep = #{jgDep}</if>
<if test= "zyyj != null and zyyj != ''" > and zyyj = #{zyyj}</if>
<if test= "createBy != null and createBy != ''" > and create_by = #{createBy}</if>
<if test= "params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''" > and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test= "updateBy != null and updateBy != ''" > and update_by = #{updateBy}</if>
<if test= "params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''" > and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}</if>
<if test= "remark != null and remark != ''" > and remark = #{remark}</if>
and isStatus = 1
</where>
order by create_time desc
</select>
<select id= "selectTcZdlyjgById" parameterType= "Long" resultMap= "TcZdlyjgResult" >
<include refid= "selectTcZdlyjgVo" />
where id = #{id}
</select>
<insert id= "insertTcZdlyjg" parameterType= "TcZdlyjg" useGeneratedKeys= "true" keyProperty= "id" >
insert into tc_zdlyjg
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "areaId != null" > area_id,</if>
<if test= "isStatus != null" > isStatus,</if>
<if test= "enterpriseType != null" > enterprise_type,</if>
<if test= "jgObgj != null" > jg_obgj,</if>
<if test= "jzxw != null" > jzxw,</if>
<if test= "jgDep != null" > jg_dep,</if>
<if test= "zyyj != null" > zyyj,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "updateBy != null" > update_by,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "remark != null" > remark,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "areaId != null" > #{areaId},</if>
<if test= "isStatus != null" > #{isStatus},</if>
<if test= "enterpriseType != null" > #{enterpriseType},</if>
<if test= "jgObgj != null" > #{jgObgj},</if>
<if test= "jzxw != null" > #{jzxw},</if>
<if test= "jgDep != null" > #{jgDep},</if>
<if test= "zyyj != null" > #{zyyj},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "updateBy != null" > #{updateBy},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "remark != null" > #{remark},</if>
</trim>
</insert>
<update id= "updateTcZdlyjg" parameterType= "TcZdlyjg" >
update tc_zdlyjg
<trim prefix= "SET" suffixOverrides= "," >
<if test= "areaId != null" > area_id = #{areaId},</if>
<if test= "isStatus != null" > isStatus = #{isStatus},</if>
<if test= "enterpriseType != null" > enterprise_type = #{enterpriseType},</if>
<if test= "jgObgj != null" > jg_obgj = #{jgObgj},</if>
<if test= "jzxw != null" > jzxw = #{jzxw},</if>
<if test= "jgDep != null" > jg_dep = #{jgDep},</if>
<if test= "zyyj != null" > zyyj = #{zyyj},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "remark != null" > remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<update id= "updateByisStatus" >
UPDATE tc_zdlyjg
SET isStatus = #{isStatus}
WHERE id IN
<foreach collection= "ids" item= "item" index= "index" separator= "," open= "(" close= ")" >
#{item}
</foreach>
</update>
<delete id= "deleteTcZdlyjgById" parameterType= "Long" >
delete from tc_zdlyjg where id = #{id}
</delete>
<delete id= "deleteTcZdlyjgByIds" parameterType= "String" >
delete from tc_zdlyjg where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>