Newer
Older
huludao / src / main / resources / mapper / RiverManage / PatrolManageUserStateMapper.xml
<?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.newfiber.api.pc.dao.RiverManage.PatrolManageUserStateMapper">

    <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.River.PatrolManageUserState">
        <result column="id" property="id"/>
        <result column="patrol_type" property="patrolType"/>
        <result column="problem_id" property="problemId"/>
        <result column="user_no" property="userNo"/>
        <result column="problem_state" property="problemState"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <!-- 通用数据库列 -->
    <sql id="Base_Column_List">
              id,
              patrol_type,
              problem_id,
              user_no,
              problem_state,
              create_time,
              update_time
          </sql>

    <delete id="deleteByProblemId">
        delete from patrol_manage_user_state where 1=1
        <if test='problemId != null'>
            and problem_id =#{problemId}
        </if>
        <if test='patrolType != null'>
            and patrol_type = #{patrolType}
        </if>
        <if test='userNo !="" and userNo != null '>
            and user_no = #{userNo}
        </if>
    </delete>

    <update id="updateByProblemId">
        update patrol_manage_user_state set problem_state = 3
        where  1=1
        <if test='patrolType !="" and patrolType != null '>
            and patrol_type = #{patrolType}
        </if>
         and problem_id = #{problemId}
    </update>

    <update id="updateTypeAndState">
        update patrol_manage_user_state set problem_state = #{state},patrol_type=#{patrolType}
        where user_no = #{operatorNo} and problem_id = #{problemId}
    </update>
</mapper>