<?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.matrix.system.hive.dao.SysInstoreInfoDao">
|
<resultMap type="SysInstoreInfo" id="SysInstoreInfoMap">
|
<id property="id" column="ID" />
|
<result property="instoreDate" column="INSTORE_DATE" />
|
<result property="instoreType" column="INSTORE_TYPE" />
|
<result property="ammountAll" column="AMMOUNT_ALL" />
|
<result property="supplierId" column="SUPPLIER_ID" />
|
<result property="makingmanId" column="MAKING_MAN_ID" />
|
<result property="appmanId" column="APP_MAN_ID" />
|
<result property="apptime" column="APP_TIME" />
|
<result property="remark" column="REMARK" />
|
<result property="sumall" column="SUM_ALL" />
|
<result property="storeId" column="STORE_ID" />
|
<result property="checkStatus" column="CHECK_STATUS" />
|
<result property="instoreId" column="INSTORE_ID" />
|
<result property="appRemark" column="APP_REMARK" />
|
<result property="shopId" column="shop_id"/>
|
<result property="companyId" column="company_id"/>
|
|
<!-- 扩展属性 -->
|
<result property="supplierName" column="SUPPLIER_NAME" />
|
<result property="makingmanName" column="MAKING_MAN_NAME" />
|
<result property="appmanName" column="APP_MAN_NAME" />
|
<result property="storeName" column="STORE_NAME" />
|
|
</resultMap>
|
|
|
<!-- 插入方法 -->
|
<insert id="insert" parameterType="SysInstoreInfo"
|
useGeneratedKeys="true" keyProperty="id">
|
INSERT INTO sys_instore_info (
|
ID,
|
INSTORE_DATE,
|
INSTORE_TYPE,
|
AMMOUNT_ALL,
|
SUPPLIER_ID,
|
MAKING_MAN_ID,
|
APP_MAN_ID,
|
APP_TIME,
|
REMARK,
|
SUM_ALL,
|
STORE_ID,
|
CHECK_STATUS,
|
INSTORE_ID,
|
APP_REMARK,
|
shop_id,
|
company_id
|
)
|
VALUES (
|
#{id},
|
#{instoreDate},
|
#{instoreType},
|
#{ammountAll},
|
#{supplierId},
|
#{makingmanId},
|
#{appmanId},
|
#{apptime},
|
#{remark},
|
#{sumall},
|
#{storeId},
|
#{checkStatus},
|
#{instoreId},
|
#{appRemark},
|
#{shopId},
|
#{companyId}
|
)
|
</insert>
|
|
|
<!-- 根据id更新 部分更新 -->
|
<update id="update" >
|
UPDATE sys_instore_info
|
<set>
|
<if test="instoreDate != null ">
|
INSTORE_DATE = #{instoreDate},
|
</if>
|
<if test="instoreType != null and instoreType !='' ">
|
INSTORE_TYPE = #{instoreType},
|
</if>
|
<if test="ammountAll != null and ammountAll !='' ">
|
AMMOUNT_ALL = #{ammountAll},
|
</if>
|
<if test="supplierId != null and supplierId !='' ">
|
SUPPLIER_ID = #{supplierId},
|
</if>
|
<if test="makingmanId != null and makingmanId !='' ">
|
MAKING_MAN_ID = #{makingmanId},
|
</if>
|
<if test="appmanId != null and appmanId !='' ">
|
APP_MAN_ID = #{appmanId},
|
</if>
|
<if test="apptime != null ">
|
APP_TIME = #{apptime},
|
</if>
|
<if test="remark != null and remark !='' ">
|
REMARK = #{remark},
|
</if>
|
<if test="sumall != null and sumall !='' ">
|
SUM_ALL = #{sumall},
|
</if>
|
<if test="storeId != null and storeId !='' ">
|
STORE_ID = #{storeId},
|
</if>
|
<if test="checkStatus != null and checkStatus !='' ">
|
CHECK_STATUS = #{checkStatus},
|
</if>
|
<if test="instoreId != null and instoreId !='' ">
|
INSTORE_ID = #{instoreId},
|
</if>
|
<if test="appRemark != null and appRemark !='' ">
|
APP_REMARK = #{appRemark},
|
</if>
|
</set>
|
WHERE ID=#{id}
|
</update>
|
|
|
|
<!-- 批量删除 -->
|
<delete id="deleteByIds" parameterType="java.util.List">
|
delete from sys_instore_info where ID in
|
<foreach collection="list" index="index" item="item" open="("
|
separator="," close=")">
|
#{item}
|
</foreach>
|
</delete>
|
|
<!-- 根据id删除-->
|
<delete id="deleteById" >
|
DELETE FROM sys_instore_info
|
where ID=#{id}
|
</delete>
|
|
|
|
<!-- 分页查询 -->
|
<select id="selectInPage" resultMap="SysInstoreInfoMap">
|
select
|
ID,
|
INSTORE_DATE,
|
INSTORE_TYPE,
|
AMMOUNT_ALL,
|
SUPPLIER_ID,
|
(select SUPPL_NAME from sys_supplier_info t where t.id=SUPPLIER_ID) SUPPLIER_NAME,
|
MAKING_MAN_ID,
|
(select su_name from sys_users t where t.su_id=MAKING_MAN_ID) MAKING_MAN_NAME,
|
APP_MAN_ID,
|
(select su_name from sys_users t where t.su_id=APP_MAN_ID) APP_MAN_NAME,
|
APP_TIME,
|
REMARK,
|
SUM_ALL,
|
STORE_ID,
|
(select name from warehouse t where t.id = STORE_ID) STORE_NAME,
|
CHECK_STATUS,
|
INSTORE_ID,
|
APP_REMARK,
|
shop_id,
|
company_id
|
from sys_instore_info
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID = #{record.id}
|
</if>
|
<if test="record.startTime != null ">
|
and INSTORE_DATE >= #{record.startTime}
|
</if>
|
<if test="record.endTime != null ">
|
<![CDATA[and INSTORE_DATE <= #{record.endTime}]]>
|
</if>
|
<if test="record.instoreType != null and record.instoreType !='' ">
|
and INSTORE_TYPE= #{record.instoreType}
|
</if>
|
<if test="record.ammountAll != null and record.ammountAll !='' ">
|
and AMMOUNT_ALL= #{record.ammountAll}
|
</if>
|
<if test="record.supplierId != null and record.supplierId !='' ">
|
and SUPPLIER_ID = #{record.supplierId}
|
</if>
|
<if test="record.makingmanId != null and record.makingmanId !='' ">
|
and MAKING_MAN_ID = #{record.makingmanId}
|
</if>
|
<if test="record.appmanId != null and record.appmanId !='' ">
|
and APP_MAN_ID = #{record.appmanId}
|
</if>
|
<if test="record.apptime != null ">
|
and APP_TIME = #{record.apptime}
|
</if>
|
<if test="record.remark != null and record.remark !='' ">
|
and REMARK = #{record.remark}
|
</if>
|
<if test="record.sumall != null and record.sumall !='' ">
|
and SUM_ALL = #{record.sumall}
|
</if>
|
<if test="record.storeId != null and record.storeId !='' ">
|
and STORE_ID = #{record.storeId}
|
</if>
|
<if test="record.checkStatus != null and record.checkStatus !='' ">
|
and CHECK_STATUS = #{record.checkStatus}
|
</if>
|
<if test="record.instoreId != null and record.instoreId !='' ">
|
and INSTORE_ID = #{record.instoreId}
|
</if>
|
<if test="record.shopId != null and record.shopId !='' ">
|
and shop_id = #{record.shopId}
|
</if>
|
<if test="record.companyId != null and record.companyId !='' ">
|
and company_id = #{record.companyId}
|
</if>
|
</if>
|
<if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
|
<if test="pageVo.sort !=null and pageVo.order !=null">
|
order by
|
${pageVo.sort} ${pageVo.order}
|
</if>
|
<if test="pageVo.offset >=0 and pageVo.limit >0">
|
limit
|
#{pageVo.offset},#{pageVo.limit}
|
</if>
|
</if>
|
</select>
|
|
|
<!-- 查询总条数 -->
|
<select id="selectTotalRecord" resultType="java.lang.Integer">
|
select
|
count(*)
|
from
|
sys_instore_info
|
where
|
1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID = #{record.id}
|
</if>
|
<if test="record.startTime != null ">
|
and INSTORE_DATE >= #{record.startTime}
|
</if>
|
<if test="record.endTime != null ">
|
<![CDATA[and INSTORE_DATE <= #{record.endTime}]]>
|
</if>
|
<if test="record.instoreType != null and record.instoreType !='' ">
|
and INSTORE_TYPE= #{record.instoreType}
|
</if>
|
<if test="record.ammountAll != null and record.ammountAll !='' ">
|
and AMMOUNT_ALL= #{record.ammountAll}
|
</if>
|
<if test="record.supplierId != null and record.supplierId !='' ">
|
and SUPPLIER_ID = #{record.supplierId}
|
</if>
|
<if test="record.makingmanId != null and record.makingmanId !='' ">
|
and MAKING_MAN_ID = #{record.makingmanId}
|
</if>
|
<if test="record.appmanId != null and record.appmanId !='' ">
|
and APP_MAN_ID = #{record.appmanId}
|
</if>
|
<if test="record.apptime != null ">
|
and APP_TIME = #{record.apptime}
|
</if>
|
<if test="record.remark != null and record.remark !='' ">
|
and REMARK = #{record.remark}
|
</if>
|
<if test="record.sumall != null and record.sumall !='' ">
|
and SUM_ALL = #{record.sumall}
|
</if>
|
<if test="record.storeId != null and record.storeId !='' ">
|
and STORE_ID = #{record.storeId}
|
</if>
|
<if test="record.checkStatus != null and record.checkStatus !='' ">
|
and CHECK_STATUS = #{record.checkStatus}
|
</if>
|
|
<if test="record.instoreId != null and record.instoreId !='' ">
|
and INSTORE_ID = #{record.instoreId}
|
</if>
|
<if test="record.appRemark != null and record.appRemark !='' ">
|
and APP_REMARK = #{record.appRemark}
|
</if>
|
<if test="record.shopId != null and record.shopId !='' ">
|
and shop_id = #{record.shopId}
|
</if>
|
<if test="record.companyId != null and record.companyId !='' ">
|
and company_id = #{record.companyId}
|
</if>
|
</if>
|
</select>
|
|
<!-- 根据id查询-->
|
<select id="selectById" resultMap="SysInstoreInfoMap">
|
select
|
ID,
|
INSTORE_DATE,
|
INSTORE_TYPE,
|
AMMOUNT_ALL,
|
SUPPLIER_ID,
|
(select SUPPL_NAME from sys_supplier_info t where t.id=SUPPLIER_ID) SUPPLIER_NAME,
|
MAKING_MAN_ID,
|
(select su_name from sys_users t where t.su_id=MAKING_MAN_ID) MAKING_MAN_NAME,
|
APP_MAN_ID,
|
(select su_name from sys_users t where t.su_id=APP_MAN_ID) APP_MAN_NAME,
|
APP_TIME,
|
REMARK,
|
SUM_ALL,
|
STORE_ID,
|
(select name from warehouse t where t.id = STORE_ID) STORE_NAME,
|
CHECK_STATUS,
|
INSTORE_ID,
|
APP_REMARK,
|
shop_id,
|
company_id
|
from sys_instore_info
|
where ID=#{id}
|
</select>
|
|
|
<!-- 根据对象查询-->
|
<select id="selectByModel" resultMap="SysInstoreInfoMap">
|
select
|
ID,
|
INSTORE_DATE,
|
INSTORE_TYPE,
|
AMMOUNT_ALL,
|
SUPPLIER_ID,
|
(select SUPPL_NAME from sys_supplier_info t where t.id=SUPPLIER_ID) SUPPLIER_NAME,
|
MAKING_MAN_ID,
|
(select su_name from sys_users t where t.su_id=MAKING_MAN_ID) MAKING_MAN_NAME,
|
APP_MAN_ID,
|
(select su_name from sys_users t where t.su_id=APP_MAN_ID) APP_MAN_NAME,
|
APP_TIME,
|
REMARK,
|
SUM_ALL,
|
STORE_ID,
|
(select name from warehouse t where t.id = STORE_ID) STORE_NAME,
|
CHECK_STATUS,
|
INSTORE_ID,
|
APP_REMARK,
|
shop_id,
|
company_id
|
from sys_instore_info
|
where 1=1
|
<if test="record!=null">
|
<if test="record.id != null and record.id !='' ">
|
and ID = #{record.id}
|
</if>
|
<if test="record.startTime != null ">
|
and INSTORE_DATE >= #{record.startTime}
|
</if>
|
<if test="record.endTime != null ">
|
<![CDATA[and INSTORE_DATE <= #{record.endTime}]]>
|
</if>
|
<if test="record.instoreType != null and record.instoreType !='' ">
|
and INSTORE_TYPE= #{record.instoreType}
|
</if>
|
<if test="record.ammountAll != null and record.ammountAll !='' ">
|
and AMMOUNT_ALL= #{record.ammountAll}
|
</if>
|
<if test="record.supplierId != null and record.supplierId !='' ">
|
and SUPPLIER_ID = #{record.supplierId}
|
</if>
|
<if test="record.makingmanId != null and record.makingmanId !='' ">
|
and MAKING_MAN_ID = #{record.makingmanId}
|
</if>
|
<if test="record.appmanId != null and record.appmanId !='' ">
|
and APP_MAN_ID = #{record.appmanId}
|
</if>
|
<if test="record.apptime != null ">
|
and APP_TIME = #{record.apptime}
|
</if>
|
<if test="record.remark != null and record.remark !='' ">
|
and REMARK = #{record.remark}
|
</if>
|
<if test="record.sumall != null and record.sumall !='' ">
|
and SUM_ALL = #{record.sumall}
|
</if>
|
<if test="record.storeId != null and record.storeId !='' ">
|
and STORE_ID = #{record.storeId}
|
</if>
|
<if test="record.checkStatus != null and record.checkStatus !='' ">
|
and CHECK_STATUS = #{record.checkStatus}
|
</if>
|
<if test="record.instoreId != null and record.instoreId !='' ">
|
and INSTORE_ID = #{record.instoreId}
|
</if>
|
<if test="record.appRemark != null and record.appRemark !='' ">
|
and APP_REMARK = #{record.appRemark}
|
</if>
|
</if>
|
</select>
|
|
|
</mapper>
|