| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?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.ytpm.dao.AgentDitchMapper">
- <insert id="insertOne" keyProperty="ditchId" useGeneratedKeys="true">
- insert into yt_ditch
- (
- ditch_id,
- ditch_name,
- user_id,
- app_type,
- app_id,
- is_delete,
- create_time
- )
- values
- (
- #{ditchId},
- #{ditchName},
- #{userId},
- #{appType},
- #{appId},
- #{isDelete},
- #{createTime}
- )
- </insert>
- <update id="update">
- update yt_ditch
- <set>
- <if test="ditchName !=null">
- ditch_name = #{ditchName},
- </if>
- <if test="appType !=null">
- app_type = #{appType},
- </if>
- <if test="isDelete !=null">
- is_delete = #{isDelete}
- </if>
- </set>
- where ditch_id = #{ditchId}
- </update>
- <select id="ditchList" resultType="com.ytpm.agent.view.AgentDitchView">
- select
- ditch_id, ditch_name, app_type, app_id, create_time
- from yt_ditch
- <where>
- user_id = #{userId}
- <if test="ditchName != null and ditchName != ''">
- AND ditch_name LIKE CONCAT('%', #{ditchName}, '%')
- </if>
- and is_delete=0
- </where>
- </select>
- <select id="selectById" resultType="com.ytpm.agent.model.YtDitch">
- select
- ditch_id, ditch_name, user_id, app_type, app_id, is_delete, create_time
- from yt_ditch
- where ditch_id = #{ditchId}
- </select>
- </mapper>
|