123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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.basicData.mapper.TWarehouseAreaMapper">
- <resultMap type="TWarehouseArea" id="TWarehouseAreaResult">
- <result property="fId" column="f_id"/>
- <result property="fWarehouseid" column="f_warehouseid"/>
- <result property="fNo" column="f_no"/>
- <result property="fName" column="f_name"/>
- <result property="fTotalgross" column="f_totalgross"/>
- <result property="fAddr" column="f_addr"/>
- <result property="fStatus" column="f_status"/>
- <result property="delFlag" column="del_flag"/>
- <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="selectTWarehouseAreaVo">
- select f_id, f_warehouseid, f_no, f_name, f_totalgross ,f_addr, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse_area
- </sql>
- <select id="selectTWarehouseAreaList" parameterType="TWarehouseArea" resultMap="TWarehouseAreaResult">
- select a.f_id, a.f_warehouseid, a.f_no, a.f_name,w.f_totalgross, a.f_addr, a.f_status, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark from t_warehouse_area a
- left join t_warehouse w on w.f_id = a.f_warehouseid
- where a.del_flag = '0'
- <if test="fNo != null and fNo != ''">and a.f_no = #{fNo}</if>
- <if test="fName != null and fName != ''">and a.f_name like concat('%', #{fName}, '%')</if>
- <if test="fStatus != null and fStatus != ''">and a.f_status = #{fStatus}</if>
- <if test="fWarehouseid != null and fWarehouseid != 0">
- AND (a.f_warehouseid = #{fWarehouseid} OR a.f_warehouseid IN ( SELECT t.f_id FROM t_warehouse t WHERE find_in_set(#{fWarehouseid}, ancestors) ))
- </if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
- <select id="selectTWarehouseAreaById" parameterType="Long" resultMap="TWarehouseAreaResult">
- <include refid="selectTWarehouseAreaVo"/>
- where f_id = #{fId}
- </select>
- <insert id="insertTWarehouseArea" parameterType="TWarehouseArea" useGeneratedKeys="true" keyProperty="fId">
- insert into t_warehouse_area
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fWarehouseid != null">f_warehouseid,</if>
- <if test="fNo != null and fNo != ''">f_no,</if>
- <if test="fName != null and fName != ''">f_name,</if>
- <if test="fTotalgross != null">f_totalgross,</if>
- <if test="fAddr != null and fAddr != ''">f_addr,</if>
- <if test="fStatus != null">f_status,</if>
- <if test="delFlag != null">del_flag,</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="fWarehouseid != null">#{fWarehouseid},</if>
- <if test="fNo != null and fNo != ''">#{fNo},</if>
- <if test="fName != null and fName != ''">#{fName},</if>
- <if test="fTotalgross != null">#{fTotalgross},</if>
- <if test="fAddr != null and fAddr != ''">#{fAddr},</if>
- <if test="fStatus != null">#{fStatus},</if>
- <if test="delFlag != null">#{delFlag},</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="updateTWarehouseArea" parameterType="TWarehouseArea">
- update t_warehouse_area
- <trim prefix="SET" suffixOverrides=",">
- <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
- <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
- <if test="fName != null and fName != ''">f_name = #{fName},</if>
- <if test="fTotalgross != null">f_totalgross = #{fTotalgross},</if>
- <if test="fAddr != null and fAddr != ''">f_addr = #{fAddr},</if>
- <if test="fStatus != null">f_status = #{fStatus},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</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 f_id = #{fId}
- </update>
- <delete id="deleteTWarehouseAreaById" parameterType="Long">
- delete from t_warehouse_area where f_id = #{fId}
- </delete>
- <delete id="deleteTWarehouseAreaByTWarehoused" parameterType="Long">
- delete from t_warehouse_area where f_warehouseid = #{fId}
- </delete>
- <delete id="deleteTWarehouseAreaByIds" parameterType="String">
- delete from t_warehouse_area where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <select id="checkFNoUnique" resultMap="TWarehouseAreaResult">
- select f_id,f_no from t_warehouse_area where f_no = #{fNo} and f_warehouseid = #{fWarehouseid} limit 1
- </select>
- <select id="checkUFNnameUnique" resultMap="TWarehouseAreaResult">
- select f_id,f_name from t_warehouse_area where f_name = #{fNname} and f_warehouseid = #{fWarehouseid} limit 1
- </select>
- <select id="selectTWarehouseAreaByWarehouseId" resultMap="TWarehouseAreaResult">
- select f_id from t_warehouse_area where f_warehouseid = #{fId} limit 1
- </select>
- <select id="selectTWarehouseArea" resultType="java.math.BigDecimal">
- SELECT
- sum( f_totalgross ) AS fTotalgross
- FROM
- t_warehouse_area
- WHERE
- f_warehouseid = #{fId}
- </select>
- </mapper>
|