| | |
| | | <if test="p.endTime!= null and p.endTime !=''"> |
| | | and DE.create_time <= #{p.endTime} |
| | | </if> |
| | | <include refid="com.kidgrow.oprationcenter.mapper.SysProductMapper.Role_Organization"></include> |
| | | <!-- <include refid="com.kidgrow.oprationcenter.mapper.SysProductMapper.Role_Organization"></include>--> |
| | | </where> |
| | | </sql> |
| | | <select id="groupProductDetail" resultType="com.kidgrow.oprationcenter.vo.GroupProductDetail"> |
| | |
| | | <include refid="whereforall"/> |
| | | order by |
| | | DE.pro_endtime ASC, |
| | | DE.ailight_count ASC, |
| | | DE.pro_begintime ASC, |
| | | DE.id asc |
| | | DE.id ASC |
| | | </select> |
| | | |
| | | <select id="getEnabledCount" resultType="int" parameterType="long"> |
| | |
| | | WHERE |
| | | order_id IN ( SELECT id FROM product_order WHERE hospital_id = #{hospitalId} AND department_id = #{departmentId} AND is_del = 0 AND enabled = 1 ) |
| | | AND is_del = 0 |
| | | AND enabled = 1 |
| | | ORDER BY |
| | | create_time DESC |
| | | <if test="enabled!=null"> |
| | | and enabled=#{enabled} |
| | | </if> |
| | | ORDER BY id DESC |
| | | </select> |
| | | |
| | | <select id="getUserdProduct" resultType="int"> |
| | | SELECT |
| | | sum(total) |
| | | FROM |
| | | ( |
| | | SELECT |
| | | count(*) total |
| | | FROM |
| | | `product_order` order_order |
| | | LEFT JOIN product_order_record record ON order_order.id = record.order_id |
| | | WHERE |
| | | order_order.hospital_id = #{hospitalId} |
| | | AND order_order.department_id = #{departmentId} |
| | | and record.pro_id!=1000000000000000000 |
| | | AND order_order.is_del = 0 |
| | | AND order_order.enabled = 1 |
| | | AND record.is_del = 0 |
| | | AND record.enabled = 1 |
| | | AND record.pro_endtime>now() |
| | | UNION ALL |
| | | SELECT |
| | | count(*) total |
| | | FROM |
| | | `product_order` order_order |
| | | LEFT JOIN product_order_record record ON order_order.id = record.order_id |
| | | WHERE |
| | | order_order.hospital_id = #{hospitalId} |
| | | AND record.is_share = 1 |
| | | and record.pro_id!=1000000000000000000 |
| | | AND order_order.is_del = 0 |
| | | AND order_order.enabled = 1 |
| | | AND record.is_del = 0 |
| | | AND record.enabled = 1 |
| | | AND record.pro_endtime>now() |
| | | ) cc |
| | | </select> |
| | | <select id="productEndList" resultType="com.kidgrow.oprationcenter.vo.ProductEndVo"> |
| | | SELECT |
| | | id, |