138 lines
7.7 KiB
XML
138 lines
7.7 KiB
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.dao.YaopinChuruInoutListDao">
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
a.id as id
|
|
,a.yaopin_churu_inout_id as yaopinChuruInoutId
|
|
,a.yaopin_id as yaopinId
|
|
,a.yaopin_churu_inout_list_number as yaopinChuruInoutListNumber
|
|
,a.insert_time as insertTime
|
|
,a.create_time as createTime
|
|
</sql>
|
|
<select id="selectListView" parameterType="map" resultType="com.entity.view.YaopinChuruInoutListView" >
|
|
SELECT
|
|
<include refid="Base_Column_List" />
|
|
|
|
-- 级联表的字段
|
|
,yaopin.yaopin_name as yaopinName
|
|
,yaopin.yaopin_types as yaopinTypes
|
|
,yaopin.yaopin_kucun_number as yaopinKucunNumber
|
|
,yaopin.danwei_types as danweiTypes
|
|
,yaopin.yaopin_new_money as yaopinNewMoney
|
|
,yaopin.yaopin_content as yaopinContent
|
|
,yaopin.yaopin_delete as yaopinDelete
|
|
,yaopinChuruInout.yaopin_churu_inout_uuid_number as yaopinChuruInoutUuidNumber
|
|
,yaopinChuruInout.yaopin_churu_inout_name as yaopinChuruInoutName
|
|
,yaopinChuruInout.yaopin_churu_inout_types as yaopinChuruInoutTypes
|
|
,yaopinChuruInout.yaopin_churu_inout_content as yaopinChuruInoutContent
|
|
|
|
FROM yaopin_churu_inout_list a
|
|
left JOIN yaopin yaopin ON a.yaopin_id = yaopin.id
|
|
left JOIN yaopin_churu_inout yaopinChuruInout ON a.yaopin_churu_inout_id = yaopinChuruInout.id
|
|
|
|
<where>
|
|
<if test="params.ids != null">
|
|
and a.id in
|
|
<foreach item="item" index="index" collection="params.ids" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="params.yaopinChuruInoutId != null and params.yaopinChuruInoutId != ''">
|
|
and (
|
|
a.yaopin_churu_inout_id = #{params.yaopinChuruInoutId}
|
|
)
|
|
</if>
|
|
<if test="params.yaopinId != null and params.yaopinId != ''">
|
|
and (
|
|
a.yaopin_id = #{params.yaopinId}
|
|
)
|
|
</if>
|
|
<if test="params.yaopinChuruInoutListNumberStart != null and params.yaopinChuruInoutListNumberStart != ''">
|
|
<![CDATA[ and a.yaopin_churu_inout_list_number >= #{params.yaopinChuruInoutListNumberStart} ]]>
|
|
</if>
|
|
<if test="params.yaopinChuruInoutListNumberEnd != null and params.yaopinChuruInoutListNumberEnd != ''">
|
|
<![CDATA[ and a.yaopin_churu_inout_list_number <= #{params.yaopinChuruInoutListNumberEnd} ]]>
|
|
</if>
|
|
<if test="params.yaopinChuruInoutListNumber != null and params.yaopinChuruInoutListNumber != ''">
|
|
and a.yaopin_churu_inout_list_number = #{params.yaopinChuruInoutListNumber}
|
|
</if>
|
|
<if test=" params.insertTimeStart != '' and params.insertTimeStart != null ">
|
|
<![CDATA[ and UNIX_TIMESTAMP(a.insert_time) >= UNIX_TIMESTAMP(#{params.insertTimeStart}) ]]>
|
|
</if>
|
|
<if test=" params.insertTimeEnd != '' and params.insertTimeEnd != null ">
|
|
<![CDATA[ and UNIX_TIMESTAMP(a.insert_time) <= UNIX_TIMESTAMP(#{params.insertTimeEnd}) ]]>
|
|
</if>
|
|
|
|
<!-- 判断药品信息的id不为空 -->
|
|
<if test=" params.yaopinIdNotNull != '' and params.yaopinIdNotNull != null and params.yaopinIdNotNull != 'null' ">
|
|
and a.yaopin_id IS NOT NULL
|
|
</if>
|
|
<if test=" params.yaopinName != '' and params.yaopinName != null and params.yaopinName != 'null' ">
|
|
and yaopin.yaopin_name like CONCAT('%',#{params.yaopinName},'%')
|
|
</if>
|
|
<if test="params.yaopinTypes != null and params.yaopinTypes != ''">
|
|
and yaopin.yaopin_types = #{params.yaopinTypes}
|
|
</if>
|
|
|
|
<if test="params.yaopinKucunNumberStart != null and params.yaopinKucunNumberStart != '' ">
|
|
<![CDATA[ and yaopin.yaopin_kucun_number >= #{params.yaopinKucunNumberStart} ]]>
|
|
</if>
|
|
<if test="params.yaopinKucunNumberEnd != null and params.yaopinKucunNumberEnd != '' ">
|
|
<![CDATA[ and yaopin.yaopin_kucun_number <= #{params.yaopinKucunNumberEnd} ]]>
|
|
</if>
|
|
<if test="params.yaopinKucunNumber != null and params.yaopinKucunNumber != '' ">
|
|
and yaopin.yaopin_kucun_number = #{params.yaopinKucunNumber}
|
|
</if>
|
|
<if test="params.danweiTypes != null and params.danweiTypes != ''">
|
|
and yaopin.danwei_types = #{params.danweiTypes}
|
|
</if>
|
|
|
|
<if test="params.yaopinNewMoneyStart != null ">
|
|
<![CDATA[ and yaopin.yaopin_new_money >= #{params.yaopinNewMoneyStart} ]]>
|
|
</if>
|
|
<if test="params.yaopinNewMoneyEnd != null ">
|
|
<![CDATA[ and yaopin.yaopin_new_money <= #{params.yaopinNewMoneyEnd} ]]>
|
|
</if>
|
|
<if test=" params.yaopinContent != '' and params.yaopinContent != null and params.yaopinContent != 'null' ">
|
|
and yaopin.yaopin_content like CONCAT('%',#{params.yaopinContent},'%')
|
|
</if>
|
|
<if test="params.yaopinDeleteStart != null and params.yaopinDeleteStart != '' ">
|
|
<![CDATA[ and yaopin.yaopin_delete >= #{params.yaopinDeleteStart} ]]>
|
|
</if>
|
|
<if test="params.yaopinDeleteEnd != null and params.yaopinDeleteEnd != '' ">
|
|
<![CDATA[ and yaopin.yaopin_delete <= #{params.yaopinDeleteEnd} ]]>
|
|
</if>
|
|
<if test="params.yaopinDelete != null and params.yaopinDelete != '' ">
|
|
and yaopin.yaopin_delete = #{params.yaopinDelete}
|
|
</if>
|
|
<!-- 判断出入库的id不为空 -->
|
|
<if test=" params.yaopinChuruInoutIdNotNull != '' and params.yaopinChuruInoutIdNotNull != null and params.yaopinChuruInoutIdNotNull != 'null' ">
|
|
and a.yaopin_churu_inout_id IS NOT NULL
|
|
</if>
|
|
<if test=" params.yaopinChuruInoutUuidNumber != '' and params.yaopinChuruInoutUuidNumber != null and params.yaopinChuruInoutUuidNumber != 'null' ">
|
|
and yaopinChuruInout.yaopin_churu_inout_uuid_number like CONCAT('%',#{params.yaopinChuruInoutUuidNumber},'%')
|
|
</if>
|
|
<if test=" params.yaopinChuruInoutName != '' and params.yaopinChuruInoutName != null and params.yaopinChuruInoutName != 'null' ">
|
|
and yaopinChuruInout.yaopin_churu_inout_name like CONCAT('%',#{params.yaopinChuruInoutName},'%')
|
|
</if>
|
|
<if test="params.yaopinChuruInoutTypes != null and params.yaopinChuruInoutTypes != ''">
|
|
and yaopinChuruInout.yaopin_churu_inout_types = #{params.yaopinChuruInoutTypes}
|
|
</if>
|
|
|
|
<if test=" params.yaopinChuruInoutContent != '' and params.yaopinChuruInoutContent != null and params.yaopinChuruInoutContent != 'null' ">
|
|
and yaopinChuruInout.yaopin_churu_inout_content like CONCAT('%',#{params.yaopinChuruInoutContent},'%')
|
|
</if>
|
|
<if test=" params.insertTimeStart != '' and params.insertTimeStart != null ">
|
|
<![CDATA[ and UNIX_TIMESTAMP(yaopinChuruInout.insert_time) >= UNIX_TIMESTAMP(#{params.insertTimeStart}) ]]>
|
|
</if>
|
|
<if test=" params.insertTimeEnd != '' and params.insertTimeEnd != null ">
|
|
<![CDATA[ and UNIX_TIMESTAMP(yaopinChuruInout.insert_time) <= UNIX_TIMESTAMP(#{params.insertTimeEnd}) ]]>
|
|
</if>
|
|
</where>
|
|
|
|
order by a.${params.orderBy} desc
|
|
</select>
|
|
|
|
</mapper> |