|
@@ -0,0 +1,105 @@
|
|
|
+<?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.jnb.cooperative.mapper.CooperativeMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.sooka.jnb.cooperative.domain.Cooperative" id="CooperativeResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <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" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="version" column="version" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="chargePeople" column="charge_people" />
|
|
|
+ <result property="chargePhone" column="charge_phone" />
|
|
|
+ <result property="imgUrl" column="img_url" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCooperativeVo">
|
|
|
+ select id, create_by, create_time, update_by, update_time, remark, del_flag, version, name, address, charge_people, charge_phone, img_url from jnb_supply_and_marketing_cooperative
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCooperativeList" parameterType="com.sooka.jnb.cooperative.domain.Cooperative" resultMap="CooperativeResult">
|
|
|
+ <include refid="selectCooperativeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="version != null and version != ''"> and version = #{version}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
|
|
|
+ <if test="chargePeople != null and chargePeople != ''"> and charge_people like concat('%', #{chargePeople}, '%')</if>
|
|
|
+ <if test="chargePhone != null and chargePhone != ''"> and charge_phone = #{chargePhone}</if>
|
|
|
+ <if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCooperativeById" parameterType="java.lang.Long" resultMap="CooperativeResult">
|
|
|
+ <include refid="selectCooperativeVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCooperative" parameterType="com.sooka.jnb.cooperative.domain.Cooperative" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into jnb_supply_and_marketing_cooperative
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <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>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="version != null">version,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="chargePeople != null">charge_people,</if>
|
|
|
+ <if test="chargePhone != null">charge_phone,</if>
|
|
|
+ <if test="imgUrl != null">img_url,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <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>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="version != null">#{version},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="chargePeople != null">#{chargePeople},</if>
|
|
|
+ <if test="chargePhone != null">#{chargePhone},</if>
|
|
|
+ <if test="imgUrl != null">#{imgUrl},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCooperative" parameterType="com.sooka.jnb.cooperative.domain.Cooperative">
|
|
|
+ update jnb_supply_and_marketing_cooperative
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <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>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="version != null">version = #{version},</if>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="chargePeople != null">charge_people = #{chargePeople},</if>
|
|
|
+ <if test="chargePhone != null">charge_phone = #{chargePhone},</if>
|
|
|
+ <if test="imgUrl != null">img_url = #{imgUrl},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCooperativeById" parameterType="java.lang.Long">
|
|
|
+ delete from jnb_supply_and_marketing_cooperative where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCooperativeByIds" parameterType="java.lang.String">
|
|
|
+ delete from jnb_supply_and_marketing_cooperative where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|