You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tcZz-java/ruoyi-admin/src/main/resources/mapper/tcZz/netManage/TcDyMapper.xml

103 lines
5.2 KiB

2 years ago
<?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.TcDyMapper">
<resultMap type="TcDy" id="TcDyResult">
<result property="id" column="id" />
<result property="areaId" column="area_id" />
<result property="isStatus" column="isStatus" />
<result property="userName" column="user_name" />
<result property="intro" column="intro" />
<result property="fsCount" column="fs_count" />
<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="selectTcDyVo">
select id, area_id, isStatus, user_name, intro, fs_count, create_by, create_time, update_by, update_time, remark from tc_dy
</sql>
<select id="selectTcDyList" parameterType="TcDy" resultMap="TcDyResult">
<include refid="selectTcDyVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
<if test="isStatus != null "> and isStatus = #{isStatus}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="intro != null and intro != ''"> and intro = #{intro}</if>
<if test="fsCount != null and fsCount != ''"> and fs_count = #{fsCount}</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>
</where>
2 years ago
order by create_time desc
2 years ago
</select>
<select id="selectTcDyById" parameterType="Long" resultMap="TcDyResult">
<include refid="selectTcDyVo"/>
where id = #{id}
</select>
<insert id="insertTcDy" parameterType="TcDy" useGeneratedKeys="true" keyProperty="id">
insert into tc_dy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="areaId != null">area_id,</if>
<if test="isStatus != null">isStatus,</if>
<if test="userName != null">user_name,</if>
<if test="intro != null">intro,</if>
<if test="fsCount != null">fs_count,</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="userName != null">#{userName},</if>
<if test="intro != null">#{intro},</if>
<if test="fsCount != null">#{fsCount},</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="updateTcDy" parameterType="TcDy">
update tc_dy
<trim prefix="SET" suffixOverrides=",">
<if test="areaId != null">area_id = #{areaId},</if>
<if test="isStatus != null">isStatus = #{isStatus},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="intro != null">intro = #{intro},</if>
<if test="fsCount != null">fs_count = #{fsCount},</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>
<delete id="deleteTcDyById" parameterType="Long">
delete from tc_dy where id = #{id}
</delete>
<delete id="deleteTcDyByIds" parameterType="String">
delete from tc_dy where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>